[ QUESTION ] - Behavior of event's callbacks on the main event loop #6
Labels
bug
Something isn't working
help wanted
Extra attention is needed
question
Further information is requested
Description:
I have a question for myself that i don't know the answer yet, so i decided to make an issues for it so everyone can share their point of view and ideas on it.
The implementation now enable users to listen on events and have their callbacks to a specific event, for example
responseReceived
is an event which fires its associated callbacks when aClient
Object make aRequest
and receives aResponse
in order to take an action on response asynchronously.This particular event
responseReceived
and all other types of events, when fires, they actually queue their callbacks on the main event loop that VU has and running on using this code:The real question is that we need to have a different event loop for events on each Object like
Client
from the event loop used for VU or we don't need this.Current behavior
In this example even though we do
await
forclient
execution to be finished. The rest of code would occur first and then the callbacks on events that happened onclient
would be called.Opposite behavior
Should we have this?
In this example it shows that finishing the execution of
client.get()
means that finishing the executions of its events callbacks too!Additional context
If you have an idea for the behavior feel free to share it here in comments. Also it would be great if you have an idea for implementing the desired behavior you mentioning.
The text was updated successfully, but these errors were encountered: