-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Racing e.respondWith(p) #302
Comments
First settlement. |
I'm not sure racing makes sense at all. Seems like the caller can provide a promise, then conduct whatever race it'd like and resolve the promise with the winner. I think the multiple event handlers case argues against racing. Suppose that is happening unbeknownst to the authors of the two different event handlers. Nice tricky flaky bug to track down. Is e.default() a promise or a special response type that indicates 'please just use the network'? |
e.default() is a promise resolves to a response object (AbstractResponse). |
I agree with @michael-nordman, I think we should throw on a second call to If you want racing, you have to code it yourself. |
Yep, we throw on 2nd |
Tracked at crbug.com/410699 for Blink. |
History: #184
It seems ignoring the subsequent calls does not mean exactly the same thing as allowing racing. If we allow racing among multiple e.respondWith(p) calls, we need to determine whether the first fulfillment will win or the first settlement will win (including p's rejection). Seems it'd be a little magic if we wait for the first fulfillment, though.
And, do we want to allow racing across multiple event handlers?
In any case above, if we allow racing, multiple e.default() calls running in parallel should be allowed as well, I suppose.
The text was updated successfully, but these errors were encountered: