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

Add the ability to have a "sync" shutdown #27

Closed
gquittet opened this issue Jun 24, 2024 · 0 comments · Fixed by #28
Closed

Add the ability to have a "sync" shutdown #27

gquittet opened this issue Jun 24, 2024 · 0 comments · Fixed by #28
Assignees

Comments

@gquittet
Copy link
Owner

By default, the "closePromises" are executed in parallel.

Add a syncClose option that allow end-user to have a "sync" shutdown to execute promises in series.

Ex:

[() => Promise1, () => Promise2, () => Promise3]

With the actual behavior, the result can be random:

- Promise1
- Promise2
- Promise3

or

- Promise2
- Promise1
- Promise3

or

- Promise3
- Promise1
- Promise2

and so on.

The goal is now to have :

- Promise1
- Promise2 (when Promise1 is finished whatever the reason)
- Promise3 (when Promise2 is finished whatever the reason)

Also replace all Promise.all calls with Promise.allSettled to ensure all closePromises are called.

@gquittet gquittet self-assigned this Jun 24, 2024
gquittet added a commit that referenced this issue Jun 24, 2024
* Add syncClose boolean option

Issue: #27
@gquittet gquittet linked a pull request Jun 24, 2024 that will close this issue
gquittet added a commit that referenced this issue Jun 24, 2024
* Add syncClose boolean option

Issue: #27
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

Successfully merging a pull request may close this issue.

1 participant