swift-nio-extras icon indicating copy to clipboard operation
swift-nio-extras copied to clipboard

create a new module(?) that allows to use the universal bootstrap easily

Open weissi opened this issue 4 years ago • 6 comments

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).

weissi avatar May 05 '20 18:05 weissi

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

weissi avatar May 05 '20 18:05 weissi

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

weissi avatar May 05 '20 18:05 weissi

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 avatar May 05 '20 18:05 weissi

@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.

adam-fowler avatar May 06 '20 17:05 adam-fowler

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 avatar Feb 16 '21 11:02 dnadoba

@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 :(.

weissi avatar Feb 16 '21 11:02 weissi