Skip to content

Conversation

@strinnityk
Copy link
Contributor

Merges after: #94
Closes: #82

@strinnityk strinnityk requested a review from danielSanchezQ May 23, 2025 10:50
@strinnityk strinnityk self-assigned this May 23, 2025
@strinnityk strinnityk added the enhancement New feature or request label May 23, 2025
Copy link
Collaborator

@danielSanchezQ danielSanchezQ left a comment

Choose a reason for hiding this comment

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

We should consider what happens when intializing and stopping in batches. For what I see (its a bit confusing in the diff, will check later in the bran directly), it being sequential if any of the first would fail the other will not even be tried. Not saying it is the wrong behaviour, but we need to document well how does this features work.

Comment on lines +1197 to +1201
for mut receiver in receivers {
receiver.await.map_err(|error| {
let dyn_error: ::overwatch::DynError = Box::new(error);
::overwatch::overwatch::Error::from(dyn_error)
})?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Both starting and stopping are done in a sequential pattern. We could do it completely asynchronous unless there is a reason to do it in order. In this case I think is ok if we want to keep the ordering of starting and stopping for example. But we should document it.
Otherwise all at the same time should be fine as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is something we briefly addressed (in one of the many threads) in the huge lifecycle PR, because Antonio pointed this out.
The issue is I don't know of a good std way to achieve this, as I get the feeling overwatch-derive tries to be as slim as possible to not force extra dependencies onto users.
Are we okay doing this? E.g.: With futures::join_all

Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets keep sequential and just add documentation that the order of the start/stop services is up to the caller.

@strinnityk strinnityk force-pushed the chore/post-lifecycle-7/overwatch-services branch from 992ef17 to e8a814d Compare May 27, 2025 11:17
Base automatically changed from chore/post-lifecycle-7/overwatch-services to main May 27, 2025 11:20
@strinnityk strinnityk force-pushed the feature/services/start-stop-services-list branch from e17b2e1 to dd73769 Compare May 27, 2025 11:21
@strinnityk strinnityk force-pushed the feature/services/start-stop-services-list branch from dd73769 to 576b348 Compare May 27, 2025 13:02
Copy link
Collaborator

@danielSanchezQ danielSanchezQ left a comment

Choose a reason for hiding this comment

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

Can we add a test for this?

@strinnityk strinnityk merged commit 6c78ddd into main May 27, 2025
14 checks passed
@strinnityk strinnityk deleted the feature/services/start-stop-services-list branch May 27, 2025 16:22
@strinnityk strinnityk mentioned this pull request Jun 9, 2025
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature(services: Add start_services and stop_services to Services

3 participants