mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
* Add synchronous channel options Motivation: The functions for getting and setting channel options are currently asynchronous. This ensures that options are set and retrieved safely. However, in some cases the caller knows they are on the correct event loop but still has to pay the cost of allocating a future to either get or set an option. Modifications: - Add a 'NIOSynchronousChannelOptions' protocol for getting and setting options - Add a customisation point to 'Channel' to return 'NIOSynchronousChannelOptions'. - Default implementation returns nil so as to not break API. - Add implementations for 'EmbeddedChannel' and 'BaseSocketChannel' - Allocation tests for getting and setting autoRead Results: Options can be get and set synchronously.