Zewo

所属分类:Python编程
开发工具:Swift
文件大小:0KB
下载次数:0
上传日期:2020-03-26 16:31:25
上 传 者sh-1993
说明:  macOS和Linux上Swift中由协同程序支持的web服务器应用程序的轻量级库。
(Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.)

文件列表:
.jazzy.yaml (760, 2020-03-26)
.swift-version (4, 2020-03-26)
CODE_OF_CONDUCT.md (3345, 2020-03-26)
CONTRIBUTING.md (5183, 2020-03-26)
Images/ (0, 2020-03-26)
Images/zewo.png (39726, 2020-03-26)
LICENSE.md (1071, 2020-03-26)
Package.swift (1255, 2020-03-26)
Resources/ (0, 2020-03-26)
Resources/logo.afdesign (50642, 2020-03-26)
Sources/ (0, 2020-03-26)
Sources/CHTTPParser/ (0, 2020-03-26)
Sources/CHTTPParser/http_parser.c (74906, 2020-03-26)
Sources/CHTTPParser/include/ (0, 2020-03-26)
Sources/CHTTPParser/include/http_parser.h (14313, 2020-03-26)
Sources/CYAJL/ (0, 2020-03-26)
Sources/CYAJL/include/ (0, 2020-03-26)
Sources/CYAJL/include/yajl_common.h (2572, 2020-03-26)
Sources/CYAJL/include/yajl_gen.h (7055, 2020-03-26)
Sources/CYAJL/include/yajl_parse.h (9891, 2020-03-26)
Sources/CYAJL/include/yajl_tree.h (7166, 2020-03-26)
Sources/CYAJL/include/yajl_version.h (358, 2020-03-26)
Sources/CYAJL/yajl.c (5060, 2020-03-26)
Sources/CYAJL/yajl_alloc.c (1512, 2020-03-26)
Sources/CYAJL/yajl_alloc.h (1253, 2020-03-26)
Sources/CYAJL/yajl_buf.c (2522, 2020-03-26)
Sources/CYAJL/yajl_buf.h (1863, 2020-03-26)
Sources/CYAJL/yajl_bytestack.h (2383, 2020-03-26)
Sources/CYAJL/yajl_encode.c (7272, 2020-03-26)
Sources/CYAJL/yajl_encode.h (1308, 2020-03-26)
... ...

Zewo

Swift License Slack Codebeat

Why Zewo? Support Community Contributing

# Zewo **Zewo** is a lightweight library for web applications in Swift. ## What sets Zewo apart? Zewo is **not** a web framework. Zewo is a lightweight library for web applications in Swift. Most server-side Swift projects use Grand Central Dispatch (**GCD**) as the concurrency library of choice. The drawback of using GCD is that its APIs are **asynchronous**. With async code comes **callback hell** and we all know it, it's no fun. Node.js is the best example of how callbacks can be frustrating. Express.js creator **TJ Holowaychuk** wrote a blog post about [Callback vs Coroutines](https://medium.com/@tjholowaychuk/callbacks-vs-coroutines-174f1fe66127#.3l3pf1xqf) in 2013 and one year later [left the Node.js community](https://medium.com/@tjholowaychuk/farewell-node-js-4ba9e7f3e52b#.okwqsltyx) in favor of Go. There were many reasons for that but one of the main reasons was the concurrency model. Sure we have futures and promises and functional reactive programming. They all mitigate the problem, but the async nature of the code will always be there. At **Zewo** we use **coroutines**. Coroutines allow concurrency while maintaining **synchronous** APIs. We all learn how to program with synchronous code. We're used to reason about our code synchronously. Being able to use synchronous APIs makes the code much more readable and understandable. Coroutines are also **faster** than threads, because they live in user-space, unlike threads which are managed by the kernel. Our implementation of **coroutines** (which is based on [libdill](https://github.com/sustrik/libdill)) is **single-threaded**. This means that you don't have to worry about **locks** or **race conditions**. So your code is **safer** by default. To use all the CPU power available all you have to do is to replicate the work according to the number of logical CPUs available. As an example, this could mean running as many processes of your server as cores in your machine. **Rob Pike**, one of the creators of Go had a talk called [Concurrency is not Parallelism](https://www.youtube.com/watch?v=cN_DpYBzKso) that explains this concept **very** well. Go also has the philosophy: ``` Don't communicate by sharing memory. Share memory by communicating. ``` Like Go, instead of sharing memory and handling state we promote the use of [CSP](https://en.wikipedia.org/wiki/Communicating_sequential_processes)-style concurrency using channels. This pattern brings the abstractions used on the development of distributed systems closer to the way we're used to think about communication. It also aligns well with Swift's mindset of immutability and value types. All of these things contributes to a distinct experince on the server-side Swift. With **Zewo** you get: * Go-style concurrency * Synchronous APIs * Incredible performance * Safer applications * Scalable systems * Cleaner code * Proper error handling * No callback hell * No race conditions ## Support If you have **any** trouble create a Github [issue](https://github.com/Zewo/Zewo/issues/new) and we'll do everything we can to help you. When stating your issue be sure to add enough details and reproduction steps so we can help you faster. If you prefer you can join our [Slack](http://slack.zewo.io) and go to the **#help** channel too. ## Community We have an amazing community of open and welcoming developers. Join us on [Slack](http://slack.zewo.io) to get to know us! ## License All **Zewo** modules are released under the MIT license. See [LICENSE](LICENSE) for details. [slack-image]: http://s13.postimg.org/ybwy92ktf/Slack.png [slack-url]: http://slack.zewo.io

近期下载者

相关文件


收藏者