Closed Mordil closed 3 years ago
Honestly, this request could be chalked up to a reflective "This isn't DRY!" seeing a few different modules all proliferating their own enum types when they all work with the same underlying value of passing NIO EventLoop
or EventLoopGroup
@Mordil thanks! .unique(...)
isn't necessary because each EventLoop
is also an EventLoopGroup
. So could do can do .shared(myEventLoop)
.
So I think I'd be happy for this to be in NIOExtras. After all, it's our incubation repo.
@normanmaurer / @Lukasa WDYT?
Works for me.
This was resolved by https://github.com/apple/swift-nio/pull/1609
As we've seen so far in the SSWG pitches/proposals for the
nio-postgres
(nio-redis
initially modeled after this proposal) andnio-http
packages there's been this idea of NIO-based library authors providing a means to users to either pass in their ownEventLoopGroup
they might intend to share, but still maintain ownership over the lifecycle, or to let the library decide that detail for itself.NIORedis
used to have an implementation and this was previously proposed as a part of NIO core but was rejected as it was too broad of a solution to be in NIO proper.Could this have a home here? (bikeshedding the naming, of course)
perhaps a third case could be given that is
.unique(EventLoopGroup)
for the cases where a library might be the one that wants to provideEventLoopGroup
s, but that it's giving ownership of it to whoever is asking for anEventLoopGroupProvider
?