Skip to content

Commit 54ac288

Browse files
authored
Update README.md
1 parent d79d290 commit 54ac288

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

README.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -334,27 +334,11 @@ protocol AsyncSocketPool {
334334
}
335335
```
336336

337-
### PollingSocketPool
337+
### SocketPool
338338

339-
`PollingSocketPool` is the default pool used within `HTTPServer`. It uses a continuous loop of [`poll(2)`](https://www.freebsd.org/cgi/man.cgi?poll) / [`Task.yield()`](https://developer.apple.com/documentation/swift/task/3814840-yield) to check all sockets awaiting data at a supplied interval.
340-
341-
The pool can be tuned to adjust both the time spent within [`poll(2)`](https://www.freebsd.org/cgi/man.cgi?poll) and at the end of each iteration with [`Task.yield()`](https://developer.apple.com/documentation/swift/task/3814840-yield) or [`Task.sleep()`](https://developer.apple.com/documentation/swift/task/3862701-sleep)
342-
343-
```swift
344-
let pool = PollingSocketPool(pollInterval: .immediate, loopInterval: .seconds(0.1))
345-
let server = HTTPServer(port: 80, pool: pool)
346-
```
347-
348-
### EventQueueSocketPool
349-
350-
The experimental [`EventQueueSocketPool<Queue>`](https://github.com/swhitty/FlyingFox/blob/main/FlyingSocks/Sources/EventQueueSocketPool.swift) suspends and resume sockets using kernel events without the need to continuosly poll the waiting file descriptors. The pool uses a queue to add, remove and be notified of events, abstracting [`kqueue(2)`](https://www.freebsd.org/cgi/man.cgi?kqueue) on Darwin platforms and [`epoll(7)`](https://man7.org/linux/man-pages/man7/epoll.7.html) on Linux.
351-
352-
`EventQueueSocketPool<Queue>` and associated types will be made `public` in the future. In the meantime they can be used like so:
353-
354-
```swift
355-
let server = HTTPServer(port: 80, pool: makeEventQueuePool())
356-
```
339+
[`SocketPool<Queue>`](https://github.com/swhitty/FlyingFox/blob/main/FlyingSocks/Sources/SocketPool.swift) is the default pool used within `HTTPServer`. It suspends and resume sockets using its generic `EventQueue` depending on the platform. Abstracting [`kqueue(2)`](https://www.freebsd.org/cgi/man.cgi?kqueue) on Darwin platforms and [`epoll(7)`](https://man7.org/linux/man-pages/man7/epoll.7.html) on Linux, the pool uses kernel events without the need to continuosly poll the waiting file descriptors.
357340

341+
Windows uses a queue backed by a continuous loop of [`poll(2)`](https://www.freebsd.org/cgi/man.cgi?poll) / [`Task.yield()`](https://developer.apple.com/documentation/swift/task/3814840-yield) to check all sockets awaiting data at a supplied interval.
358342

359343
## SocketAddress
360344

0 commit comments

Comments
 (0)