Skip to content

Commit 8a0fa7e

Browse files
rafaelcepedazaneenders
authored andcommitted
Fix docc (#3315)
This change fixes an example shown in the ServerBootstrap documentation. ### Motivation: The current example given to users of ServerBootstrap will show a Sendable conformance warning in Swift 6.0 or later. ### Modifications: Changed the example to use `syncOperations` ### Result: The new example doesn't contain any warnings.
1 parent a79de6d commit 8a0fa7e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Sources/NIOPosix/Bootstrap.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ internal enum NIOOnSocketsBootstraps {
5252
///
5353
/// // Set the handlers that are applied to the accepted child `Channel`s.
5454
/// .childChannelInitializer { channel in
55-
/// // Ensure we don't read faster then we can write by adding the BackPressureHandler into the pipeline.
56-
/// channel.pipeline.addHandler(BackPressureHandler()).flatMap { () in
57-
/// // make sure to instantiate your `ChannelHandlers` inside of
58-
/// // the closure as it will be invoked once per connection.
59-
/// channel.pipeline.addHandler(MyChannelHandler())
60-
/// }
55+
/// channel.eventLoop.makeCompletedFuture {
56+
/// // Ensure we don't read faster than we can write by adding the BackPressureHandler into the pipeline.
57+
/// try channel.pipeline.syncOperations.addHandler(BackPressureHandler())
58+
/// try channel.pipeline.syncOperations.addHandler(MyChannelHandler())
59+
/// }
6160
/// }
6261
///
6362
/// // Enable SO_REUSEADDR for the accepted Channels

0 commit comments

Comments
 (0)