async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

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

Open weissi opened this issue 3 years ago • 0 comments

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

https://github.com/swift-server/async-http-client/blob/24425989dadab6d6e4167174791a23d4e2a6d0c3/Sources/AsyncHTTPClient/HTTPClient.swift#L551

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?

weissi avatar May 05 '22 09:05 weissi