Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3574)

Issue 12861043: Add parallel runner utility.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by rvb
Modified:
10 years, 8 months ago
Reviewers:
rog, jameinel, mp+179941
Visibility:
Public.

Description

Add parallel runner utility. Following Roger's advice, this branch adds a new parallel runner utility in utils/parallel. The utility is used to replace the custom code in the Azure provider which deletes the machines concurrently. The utility is taken from Roger's https://code.google.com/p/rog-go/ and slightly adapted (couple of variable renamed, usage of the testing utilities from juju). The code from the provider is unit-tested but since the new code does exactly the same as the old one, the tests are not affected. https://code.launchpad.net/~rvb/juju-core/parallel-helper/+merge/179941 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -35 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/azure/environ.go View 2 chunks +9 lines, -35 lines 0 comments Download
A utils/parallel/parallel.go View 1 chunk +85 lines, -0 lines 6 comments Download
A utils/parallel/parallel_test.go View 1 chunk +108 lines, -0 lines 0 comments Download

Messages

Total messages: 5
rvb
Please take a look.
10 years, 9 months ago (2013-08-13 15:13:02 UTC) #1
rog
On 2013/08/13 15:13:02, rvb wrote: > Please take a look. LGTM
10 years, 9 months ago (2013-08-13 15:16:31 UTC) #2
jameinel
I have some comments about the structure, but nothing that needs to block. LGTM https://codereview.appspot.com/12861043/diff/1/utils/parallel/parallel.go ...
10 years, 8 months ago (2013-08-14 10:19:13 UTC) #3
rog
https://codereview.appspot.com/12861043/diff/1/utils/parallel/parallel.go File utils/parallel/parallel.go (right): https://codereview.appspot.com/12861043/diff/1/utils/parallel/parallel.go#newcode51 utils/parallel/parallel.go:51: // TODO sort errors by original order of Do ...
10 years, 8 months ago (2013-08-14 10:47:20 UTC) #4
rvb
10 years, 8 months ago (2013-08-14 12:33:11 UTC) #5
Thanks for the reviews guys!

> **jam**
>
>
https://codereview.appspot.com/12861043/diff/1/utils/parallel/parallel.go#new...
>utils/parallel/parallel.go:37: func NewRun(maxPar int) *Run {
> It would be nice if you could just rename this to "maxParallel". Or even just
> "num".

Done.

> **rog**
>
> https://codereview.appspot.com/12861043/diff/1/utils/parallel/parallel.go
> File utils/parallel/parallel.go (right):
> 
>
https://codereview.appspot.com/12861043/diff/1/utils/parallel/parallel.go#new...
> utils/parallel/parallel.go:51: // TODO sort errors by original order of Do
> request?
> s/TODO/TODO(rog)/

Fixed.

> **rog**
>
> The tests pass fine with the race detector BTW.

Nice!
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b