You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use libq to create a timeout for a function that may take too long to complete. So the case is that if the function completes in time, say 5 seconds, it's ok, otherwise I want the promise to be rejected. So I created a shared promise, with one branch running the function, and another running a .delay(5s).then(...). But now I want to "cancel" the delay task if my function was completed within 5s. What would be the preferred way for this?
Best regards,
Tom,
The text was updated successfully, but these errors were encountered:
Hello,
I'm trying to use libq to create a timeout for a function that may take too long to complete. So the case is that if the function completes in time, say 5 seconds, it's ok, otherwise I want the promise to be rejected. So I created a shared promise, with one branch running the function, and another running a .delay(5s).then(...). But now I want to "cancel" the delay task if my function was completed within 5s. What would be the preferred way for this?
Best regards,
Tom,
The text was updated successfully, but these errors were encountered: