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 Spinner manager #198

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add Spinner manager #198

wants to merge 4 commits into from

Conversation

filippobrizzi
Copy link
Collaborator

Description

The SpinnersManager allows to orchestrate the start and termination of multiple spinners.

The most important functionality is the waitAny function which allows to unblock as soon as one of the spinner terminates. In this way we can proceed to stop all of the other. This is very useful in the context of errors.

Comment on lines +28 to +29
void waitAll();
void waitAny();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
void waitAll();
void waitAny();
/// @brief blocks until all spinners are finished. If a single spinner throws an exception, it will not be propagated as the other spinners are still blocking.
void waitAll();
/// @brief wait until any spinner terminates or throws an exception, which allows for immediate exception handling.
void waitAny();

The naming is clear, but given this is somewhat complex async behavior, I would add these two lines. I'm not sure waitAll is useful tbh, as it only is useful if the spinner terminates on its own AND does never throw, which seems a non-existing case. While it is elegant and adds completeness, I feel like removing it.

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 this pull request may close these issues.

2 participants