Skip to content
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

Resolving pending promises on Promise.Race prevents useful scenarios #60

Open
JesperTreetop opened this issue Mar 21, 2018 · 1 comment

Comments

@JesperTreetop
Copy link

JesperTreetop commented Mar 21, 2018

When using Promise.Race, it immediately resolves the promise. I imagine this is to resolve the race's own return promise. I'm trying to race a promise created from user code with one created from my code, set to reject after a time interval, in order to provide a timeout for the user code running in the promise, or finish promises that were created but never neither resolved nor rejected, akin to this article.

@Oceanswave
Copy link
Member

Just a quick update -- have been looking into this and see that you're absolutely right in that this does prevent a nice co-existence of tasks with promises. I'm looking at ways of fixing this, but still ensuring that the single-threaded model of the chakra engine is sustained.

The task's continuation needs to be ensured to be run on the same thread that the chrakracore engine is bound to, and I'm figuring out how to accomplish this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants