swift-server/async-http-client

is `precondition(eventLoopGroup.contains(eventLoop))` required for `.delegate(on: eventLoop)`?

weissi opened this issue · 0 comments

There's this assertion which tests that a provided eventLoop for a request is part of AHC's eventLoopGroup.

precondition(self.eventLoopGroup.makeIterator().contains { $0 === eventLoop }, "Provided EventLoop must be part of clients EventLoopGroup.")

It's clear that this precondition is required for delegateAndChannel(on: eventLoop) but I'm not sure if it's actually required for delegate(on: eventLoop). Why could AHC not open a connection on some EL of its ELG and then call the delegate/user futures on the provided EL even if that's on another ELG?