Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"All" - there is normally just one. Why do you think previous description wasn't clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From reading implementations of
StartAsync
(I can find two:services.Manager
andservices.BasicService
), I have to agree with @pstibrany. AFAICS "child operation contexts" would only describe theservices.Manager
implementation, which just acts as a proxy to its managed Services. The current documentation describes the context usage well IMO.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that
services.Manager
does not implementService
interface.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pstibrany ugh, you're right. It only implements part of it (at least the
StartAsync
method). This is one reason I wish Go had explicit implementations (as Rust traits do), would make reading code a lot easier :/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
firstly, "for service own context" is nongrammatical -- it should at least be "for the service's own context".
I lost a week because I was passing in a timeout context, thinking that it would be used for the startup phase only. I am trying to make it more clear that the context is persisted inside the service object and used repeatedly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that the language could be improved, but the PR changes the meaning of the comment :) I think the following would be the right phrasing (I refer to
ctx
as the argument):Maybe the usage of the service context should be documented better (to avoid the type of rabbit hole @ywwg descended into)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed privately with @ywwg. Paraphrased: