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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue