Event handlers are currently executed in paralell fr the same priority, but in sequence overall and generally block the event queue until their completion. The intended workflow for non-blocking handlers is to create and schedule a task using the ReturnValue namedtuple, which the dispatcher waits for in the case the event handler needs to modify the event queue.
However, this use case is much more likely than modifying the queue and should thus be the default in order to reduce boilerplate code for the 90% case.
I'm currently thinking of adding a keyword argument to the event decorator, but I'm a bit out of touch with the code base since I haven't touched it in 3 years. Regardless, I'm creating this issue to remind myself of the problem. I should note that by doing this, order of execution is not guaranteed, but that should be self-evident by the meaning of "non-blocking" and is really no different from the status quo when a task is "scheduled for later".
Event handlers are currently executed in paralell fr the same priority, but in sequence overall and generally block the event queue until their completion. The intended workflow for non-blocking handlers is to create and schedule a task using the
ReturnValue
namedtuple, which the dispatcher waits for in the case the event handler needs to modify the event queue.However, this use case is much more likely than modifying the queue and should thus be the default in order to reduce boilerplate code for the 90% case.
I'm currently thinking of adding a keyword argument to the
event
decorator, but I'm a bit out of touch with the code base since I haven't touched it in 3 years. Regardless, I'm creating this issue to remind myself of the problem. I should note that by doing this, order of execution is not guaranteed, but that should be self-evident by the meaning of "non-blocking" and is really no different from the status quo when a task is "scheduled for later".Also related reading (and what kind of lead me to this thought): https://lucumr.pocoo.org/2020/1/1/async-pressure/