Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept any EventLoops in .delegate(on:), not just ones from AHC's own ELG #653

Open
weissi opened this issue Jan 10, 2023 · 0 comments
Open

Comments

@weissi
Copy link
Contributor

weissi commented Jan 10, 2023

The badly named but highly useful .delegate(on:) specifies two things:

  1. Which EventLoop the returned futures are bound to
  2. Which EventLoop the delegate callouts happen on.

Crucially it does not specify on what EventLoop the underlying Channels are running on. Yes, as an optimisation if possible & sensible (i.e. the connection pool doesn't already have a valid connection) we try to create new Channels on the same EventLoop but that's neither guaranteed nor required.

Expected behaviour

If I pass a random EventLoop to AHC's eventLoop: .delegate(on: myRandomEL) then I would expect this to work, even if AHC itself is using an EventLoopGroup that doesn't contain my EventLoop for its Channels.

Actual behaviour

AHC crashes and tells me that I can only use EventLoops from AHC's EventLoopGroup at runtime. That's bad an unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant