@@ -2,22 +2,22 @@ import Foundation
22import NIO
33
44extension ClientBootstrap {
5- /// Makes a new `ClientBootstrap` instance with a standard Redis `Channel` pipeline for sending and receiving
6- /// messages in Redis Serialization Protocol (RESP) format.
5+ /// Makes a new `ClientBootstrap` instance with a default Redis `Channel` pipeline
6+ /// for sending and receiving messages in Redis Serialization Protocol (RESP) format.
77 ///
8- /// See `RESPEncoder`, `RESPDecoder`, and `RedisCommadHandler`.
8+ /// See `RESPEncoder`, `RESPDecoder`, and `RedisCommadHandler`
99 /// - Parameter using: The `EventLoopGroup` to build the `ClientBootstrap` on.
10- /// - Returns: A `ClientBootstrap` with the standard configuration of a `Channel` pipeline for RESP messages.
11- public static func makeForRedis ( using group: EventLoopGroup ) -> ClientBootstrap {
10+ /// - Returns: A `ClientBootstrap` with the default configuration of a `Channel` pipeline for RESP messages.
11+ public static func makeRedisDefault ( using group: EventLoopGroup ) -> ClientBootstrap {
1212 return ClientBootstrap ( group: group)
13- . channelOption ( ChannelOptions . socket ( SocketOptionLevel ( SOL_SOCKET ) , SO_REUSEADDR ) , value : 1 )
14- . channelInitializer { channel in
15- let handlers : [ ChannelHandler ] = [
16- MessageToByteHandler ( RESPEncoder ( ) ) ,
17- ByteToMessageHandler ( RESPDecoder ( ) ) ,
18- RedisCommandHandler ( )
19- ]
20- return . andAllSucceed ( handlers . map { channel . pipeline . addHandler ( $0 ) } , on : group . next ( ) )
21- }
13+ . channelOption (
14+ ChannelOptions . socket ( SocketOptionLevel ( SOL_SOCKET ) , SO_REUSEADDR ) ,
15+ value : 1
16+ )
17+ . channelInitializer { $0 . pipeline . addHandlers ( [
18+ MessageToByteHandler ( RESPEncoder ( ) ) ,
19+ ByteToMessageHandler ( RESPDecoder ( ) ) ,
20+ RedisCommandHandler ( )
21+ ] ) }
2222 }
2323}
0 commit comments