Hi, Imagine the following code:

addEventListener("start", (user) => handler(user),);

async function handler(user) {
   await fetch();
   await fetch();
   await fetch()
          .then(x => fetch());
}

For this code, I want to have carried timeout. I have a 15 seconds time out 
of the budget at the start and each promise reduces this time when we reach 
zero we just throw an exception. This is trivial to implement if we are 
handling an event at a time. But I need to handle multiple events 
concurrently. I wondered if there is a way to create a scope per event that 
contains a start time and whenever a promise is polled or finished we check 
if the timeout is reached and if so, we reject all promises in the scope 
and throw an exception.

Thank you for your time reading this.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/a8a8f599-2df5-432d-9fe2-bfea13e83ddcn%40googlegroups.com.

Reply via email to