swift-nio-extras
swift-nio-extras copied to clipboard
create a new module(?) that allows to use the universal bootstrap easily
I just had to create quite a long example on how to use the universal bootstrap over at https://github.com/apple/swift-nio-examples/pull/48 . That is too long and unwieldy. NIO needs to do better.
We should create a new module(?) in this repo (swift-nio-extras) possibly called NIOUniversal
or so which gets tools that are useful for using NIO universally across multiple networking platforms (BSD Sockets, Network.framework, and maybe soon IOCP).
The seed for this module could be EventLoopGroupManager
(probably needs a better name): https://github.com/apple/swift-nio-examples/pull/48/files#diff-f7cf525c49713fc729e91d7720262e47R34
CC @tanner0101 / @adam-fowler / @artemredkin / @Yasumoto who are at least some of the folks who we had suffer through repeating this code.
Example: https://github.com/swift-server/async-http-client/commit/5298f20331af01d5a5ebab0dee45c032847aab55#diff-8798af428c5cad17d0051540505e9d00R76
Please leave comments with stuff that you think this needs to support. The community wanted NIO anyway to provide a standard EventLoopGroup
provider (#49) which could be solved with this issue too.
@weissi is there any point adding a TLS provider if useTLS is set to false? In the async-http-client example above in the situation where we are going through a proxy and TLS is to added later on in the pipeline I create the bootstrap as follows
bootstrap = NIOClientTCPBootstrap(tsBootstrap, tls: NIOInsecureNoTLS())
Don't know if it really makes any difference.
Any progress on this topic?EventLoopGroupManager
looks actually really good! Maybe we can just move it into swift-nio-extras so we don't need to copy & past it.
@dnadoba I think we haven't resolved a really boring issue yet: Where can this live? I think it would depend on NIO, NIOSSL, and NIOTS at least but we can't really make this repo depend on them all :(.