Explain non-blocking I/O

Motivation:

It would be nice to have a bit of an explainer on the name.

Modifications:

Add a paragraph explaining non-blocking I/O.

Result:

There is now a paragraph in the readme explaining non-blocking I/O.
This commit is contained in:
Cory Benfield 2018-02-21 08:39:52 +00:00
parent 2180d03690
commit 93a1f8e6fd
1 changed files with 4 additions and 2 deletions

View File

@ -9,13 +9,15 @@ It's like [Netty](https://netty.io), but written for Swift.
SwiftNIO is fundamentally a low-level tool for building high-performance networking applications in Swift. It particularly targets those use-cases where using a "thread-per-connection" model of concurrency is inefficient or untenable. This is a common limitation when building servers that use a large number of relatively low-utilisation connections, such as HTTP servers.
However, SwiftNIO does not aim to provide high-level solutions like, for example, web frameworks do. Instead, SwiftNIO is focused on providing the low-level building blocks for these higher-level applications. When it comes to building a web application, most users will not want to use SwiftNIO directly: instead, they'll want to use one of the many great web frameworks available in the Swift ecosystem. Those web frameworks, however, may choose to use SwiftNIO under the covers to provide their networking support.
To achieve its goals SwiftNIO extensively uses "non-blocking I/O": hence the name! Non-blocking I/O differs from the more common blocking I/O model because the application does not wait for data to be sent to or received from the network: instead, SwiftNIO asks for the kernel to notify it when I/O operations can be performed without waiting.
SwiftNIO does not aim to provide high-level solutions like, for example, web frameworks do. Instead, SwiftNIO is focused on providing the low-level building blocks for these higher-level applications. When it comes to building a web application, most users will not want to use SwiftNIO directly: instead, they'll want to use one of the many great web frameworks available in the Swift ecosystem. Those web frameworks, however, may choose to use SwiftNIO under the covers to provide their networking support.
The following sections will describe the low-level tools that SwiftNIO provides, and provide a quick overview of how to work with them. If you feel comfortable with these concepts, then you can skip right ahead to the other sections of this README.
### Basic Architecture
The basic building blocks of SwiftNIO are the following 6 types of object:
The basic building blocks of SwiftNIO are the following 6 types of objects:
- `EventLoopGroup`, a protocol
- `EventLoop`, a protocol