fix(measurex): allow API user to choose parallelism (#581)
Closes https://github.com/ooni/probe/issues/1818
This commit is contained in:
parent
3b27780836
commit
ba7b981fcb
11 changed files with 88 additions and 34 deletions
|
|
@ -88,9 +88,14 @@ func main() {
|
|||
//
|
||||
// - all the endpoints to measure
|
||||
//
|
||||
// The parallelism argument tells the code how many parallel goroutines
|
||||
// to use for parallelizable operations. If this value is zero or negative,
|
||||
// the code will use a reasonably small default.
|
||||
//
|
||||
// ```Go
|
||||
cookies := measurex.NewCookieJar()
|
||||
for epnt := range mx.HTTPEndpointGetParallel(ctx, cookies, httpEndpoints...) {
|
||||
const parallelism = 3
|
||||
for epnt := range mx.HTTPEndpointGetParallel(ctx, parallelism, cookies, httpEndpoints...) {
|
||||
m.Endpoints = append(m.Endpoints, epnt)
|
||||
}
|
||||
// ```
|
||||
|
|
|
|||
Loading…
Reference in a new issue