fix(measurex): allow API user to choose parallelism (#581)
Closes https://github.com/ooni/probe/issues/1818
This commit is contained in:
@@ -87,9 +87,14 @@ Then, we call `HTTPEndpointGetParallel`. The arguments are:
|
||||
|
||||
- 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)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
// ```
|
||||
|
||||
Reference in New Issue
Block a user