fix(measurex): allow API user to choose parallelism (#581)

Closes https://github.com/ooni/probe/issues/1818
This commit is contained in:
Simone Basso
2021-11-05 14:37:03 +01:00
committed by GitHub
parent 3b27780836
commit ba7b981fcb
11 changed files with 88 additions and 34 deletions
@@ -65,6 +65,10 @@ The arguments are:
- the context as usual
- the number of parallel goroutines to use to perform parallelizable
operations (passing zero or negative will cause the code to use
a reasonably small default value)
- the unparsed URL to measure
- the headers we want to use
@@ -72,7 +76,8 @@ The arguments are:
- a jar for cookies
```Go
m, err := mx.MeasureURL(ctx, *URL, headers, cookies)
const parallelism = 3
m, err := mx.MeasureURL(ctx, parallelism, *URL, headers, cookies)
```
The return value is either an `URLMeasurement`
or an error. The error happens, for example, if
+6 -1
View File
@@ -66,6 +66,10 @@ func main() {
//
// - the context as usual
//
// - the number of parallel goroutines to use to perform parallelizable
// operations (passing zero or negative will cause the code to use
// a reasonably small default value)
//
// - the unparsed URL to measure
//
// - the headers we want to use
@@ -73,7 +77,8 @@ func main() {
// - a jar for cookies
//
// ```Go
m, err := mx.MeasureURL(ctx, *URL, headers, cookies)
const parallelism = 3
m, err := mx.MeasureURL(ctx, parallelism, *URL, headers, cookies)
// ```
// The return value is either an `URLMeasurement`
// or an error. The error happens, for example, if