mirror of
https://github.com/apple/swift-nio.git
synced 2026-05-20 20:30:36 +00:00
Update documentation comments (#2998)
Updates to documentation comments in `NIOFileSystem`. ### Motivation: I've been reviewing some parts of `NIOFileSystem` and came across a variety of formatting of documentation comments. ### Modifications: I've adopted a stricter 100-character limit (arbitrary, really; it could be longer or shorter and is totally not consistent with the rest of the repository). Also updated a bunch of grammar in comments. Fixed a few typos along the way. ### Result: - Updated comments have a better flow while reading, and aren't as abrupt as before. - Fewer typos in comments --------- Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
@@ -86,7 +86,7 @@ SwiftNIO | Minimum Swift Version
|
||||
`2.43.0 ..< 2.51.0` | 5.5.2
|
||||
`2.51.0 ..< 2.60.0` | 5.6
|
||||
`2.60.0 ..< 2.65.0` | 5.7
|
||||
`2.65.0 ..< 2.76.0 | 5.8
|
||||
`2.65.0 ..< 2.76.0` | 5.8
|
||||
`2.76.0 ...` | 5.9
|
||||
|
||||
### SwiftNIO 1
|
||||
@@ -116,7 +116,7 @@ SemVer and SwiftNIO's Public API guarantees should result in a working program w
|
||||
|
||||
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-utilization connections, such as HTTP servers.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
@@ -139,7 +139,7 @@ All SwiftNIO applications are ultimately constructed of these various components
|
||||
|
||||
#### EventLoops and EventLoopGroups
|
||||
|
||||
The basic I/O primitive of SwiftNIO is the event loop. The event loop is an object that waits for events (usually I/O related events, such as "data received") to happen and then fires some kind of callback when they do. In almost all SwiftNIO applications there will be relatively few event loops: usually only one or two per CPU core the application wants to use. Generally speaking event loops run for the entire lifetime of your application, spinning in an endless loop dispatching events.
|
||||
The basic I/O primitive of SwiftNIO is the event loop. The event loop is an object that waits for events (usually I/O related events, such as "data received") to happen and then fires some kind of callback when they do. In almost all SwiftNIO applications there will be relatively few event loops: usually only one or two per CPU core the application wants to use. Generally speaking, event loops run for the entire lifetime of your application, spinning in an endless loop dispatching events.
|
||||
|
||||
Event loops are gathered together into event loop *groups*. These groups provide a mechanism to distribute work around the event loops. For example, when listening for inbound connections the listening socket will be registered on one event loop. However, we don't want all connections that are accepted on that listening socket to be registered with the same event loop, as that would potentially overload one event loop while leaving the others empty. For that reason, the event loop group provides the ability to spread load across multiple event loops.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user