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

Use Promise.halt instead of unresolved promises #3015

Closed
w33ble opened this issue Feb 12, 2015 · 2 comments
Closed

Use Promise.halt instead of unresolved promises #3015

w33ble opened this issue Feb 12, 2015 · 2 comments

Comments

@w33ble
Copy link
Contributor

w33ble commented Feb 12, 2015

There are a handful of spots in Kibana where unresolved promises are used to stop the execution chain. The concern is that these promises are never garbage collected, so they present a memory leak issue.

In #3014, Promise.halt() was introduced, which will simply keep a single unresolved promise around, which will be the only promise that isn't garbage collected. Since then and catch are overridden in this new promise, the chain should not build up, and old parts of the chain should be garbage collected.

tl;dr unused, unresolved promises should be replaced with Promise.halt.

@w33ble w33ble changed the title Use of Promise.halt Use Promise.halt instead of unresolved promises Feb 12, 2015
@timroes
Copy link
Contributor

timroes commented Mar 29, 2018

It looks to me that this issue is outdated, since we are trying to move nowadays to Vanilla JS promises, and not have any tight to a specific (e.g. Angular) implementation of promises.

I'll close this, but feel free to reopen, if it is still relevant.

@timroes timroes closed this as completed Mar 29, 2018
@nreese
Copy link
Contributor

nreese commented Jun 29, 2018

@timroes I am trying to de-angularize some code that is using Promise.halt. What should I use in its place?

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

No branches or pull requests

3 participants