-
Notifications
You must be signed in to change notification settings - Fork 2
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 package 'concurrency' with struct ParallelWorker, include doc and example as test #133
Conversation
… example as test FYI 'go test' execute the Example and compare the output as the comment // Output: [...]
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.
Out of curiosity, what is the use case you are working on? :)
concurrency/parallel_worker.go
Outdated
|
||
// Stop should be called to release all resources. It waits for all the runnings | ||
// tasks to be over Calling Perform after this would result in a panic | ||
func (w ParallelWorker) Stop() { |
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.
I don't find the function name good. I think it does not reflect the fact that it's actually a wait. Maybe WaitAndDone
or WaitAndFinish
?
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.
ACK
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.
@EtienneM would Complete()
would be better? =p
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.
I'm not sure. The Stop
method is really just a wait operation. And from my perspective, Complete
is not clear about the face that the method will block until the computation is over.
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.
I've used CompleteProcessing
In English it sounds semantically quite good to me, what do you think?
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.
Yep OK, thanks :)
It's about the |
Co-authored-by: Étienne M. <EtienneM@users.noreply.github.com>
9608b93
to
3ffa47b
Compare
Co-authored-by: Étienne M. <EtienneM@users.noreply.github.com>
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.
Fix the specs then LGTM
@EtienneM specs are failing because of another package I would be really grateful if it would be merged =P |
(one build succeeds though!) |
OK, I opened an issue about these random specs (#134). |
FYI 'go test' execute the Example and compare the output as the comment // Output: [...]