-
Notifications
You must be signed in to change notification settings - Fork 135
Description
Right now, the delegate's methods are calling out on essentially a random EventLoop.
I think we have the guarantee, that each delegate method will at least be called on the same EventLoop?
I realise that I proposed the change to have task.currentEventLoop (which can change) but I'm not sure anymore that was a good idea. I didn't quite realise that this means that the user has no idea on what EventLoop their delegate's methods will be called on.
Maybe it would be better to go back to having a fixed EventLoop on the task and hop over in case we get a Channel from a different EventLoop from a connection pool.
The other dimension where this matters is the EventLoopPreference, that also kind of means a random EventLoop. Maybe we should just have the user specify the EventLoop they want (if they care, random one otherwise) and use that. If we get a Channel from a different EventLoop then let's just hop(to:) the correct one.
This is just an idea really but I was thinking about the programming model earlier today and 'essentially a random EventLoop' sounds like it might lead to a lot of threading bugs?
Tagging the relevant people @adtrevor / @ianpartridge / @tanner0101 / @Lukasa / @artemredkin