Skip to content

Services: Integrate into standard scripts - #474

Merged
aomarks merged 3 commits into
servicefrom
service.5
Oct 21, 2022
Merged

Services: Integrate into standard scripts#474
aomarks merged 3 commits into
servicefrom
service.5

Conversation

@aomarks

@aomarks aomarks commented Oct 21, 2022

Copy link
Copy Markdown
Member

Integrates services into standard scripts (though note services don't yet actually do anything, that's coming up next). Summary:

  1. Before a standard script runs, all of its services must have started. If any service failed to start, we fail.

  2. While a standard script is still running, if any of its services unexpectedly shuts down, then we're in an invalid state and fail too.

Part of #33

@aomarks
aomarks requested a review from justinfagnani October 21, 2022 19:48
Comment thread src/execution/base.ts
*/
protected async _startServices(): Promise<Result<void, Failure[]>> {
if (this._config.services.length > 0) {
const results = await Promise.all(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is Promise.all() ok here (over Promise.allSettled()) because you have your own error results that resolved to, not rejected?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah we throw only as a panic for an internal error, so in general we don't need to catch exceptions.

@aomarks
aomarks merged commit 0566c95 into service Oct 21, 2022
@aomarks
aomarks deleted the service.5 branch October 21, 2022 21:08
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