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

Consider returning a promise from flush method in node tracker #1087

Open
adatzer opened this issue Aug 19, 2022 · 1 comment
Open

Consider returning a promise from flush method in node tracker #1087

adatzer opened this issue Aug 19, 2022 · 1 comment
Labels
type:enhancement New features or improvements to existing features.

Comments

@adatzer
Copy link
Contributor

adatzer commented Aug 19, 2022

Is your feature request related to a problem? Please describe.
Currently gotEmitter's flush method is not async and returns void instead of a promise.
This makes it harder to use in environments where a promise is needed to ensure all async tasks complete before exiting (e.g. AWS Lambda async handlers).

Describe the solution you'd like
flush is async/returns a promise.

Describe alternatives you've considered
At the moment the way to ensure flush completes in such environments is to wrap the emitter in a promise, and configure it with a callback that resolves and rejects that promise.

@adatzer adatzer added the type:enhancement New features or improvements to existing features. label Aug 19, 2022
@paulboocock
Copy link
Contributor

I've often pondered if we should "promisify" the whole tracker...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New features or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

2 participants