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 package 'concurrency' with struct ParallelWorker, include doc and example as test #133

Merged
merged 5 commits into from
Oct 12, 2020

Conversation

Soulou
Copy link
Member

@Soulou Soulou commented Oct 7, 2020

FYI 'go test' execute the Example and compare the output as the comment // Output: [...]

… example as test

FYI 'go test' execute the Example and compare the output as the comment // Output: [...]
@Soulou Soulou requested a review from EtienneM October 7, 2020 22:14
Copy link
Member

@EtienneM EtienneM left a 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? :)


// 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() {
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

Yep OK, thanks :)

@Soulou
Copy link
Member Author

Soulou commented Oct 8, 2020

Out of curiosity, what is the use case you are working on? :)

It's about the scalingo-overview CLI I've shown in random ;-) (an helper to make the code cleaner)

Soulou and others added 2 commits October 8, 2020 16:32
@Soulou Soulou requested a review from EtienneM October 8, 2020 14:42
@Soulou Soulou force-pushed the package/concurrency/parallel_worker branch from 9608b93 to 3ffa47b Compare October 8, 2020 14:55
Co-authored-by: Étienne M. <EtienneM@users.noreply.github.com>
Copy link
Member

@EtienneM EtienneM left a 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

@Soulou
Copy link
Member Author

Soulou commented Oct 12, 2020

@EtienneM specs are failing because of another package I would be really grateful if it would be merged =P

@Soulou
Copy link
Member Author

Soulou commented Oct 12, 2020

(one build succeeds though!)

@EtienneM
Copy link
Member

OK, I opened an issue about these random specs (#134).

@EtienneM EtienneM merged commit a9bc948 into master Oct 12, 2020
@EtienneM EtienneM deleted the package/concurrency/parallel_worker branch October 12, 2020 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants