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
|
|
@ -90,7 +90,8 @@ scheme is "https". Otherwise, if it's just "http", it
|
|||
does not make sense to send this query.
|
||||
|
||||
```Go
|
||||
for dns := range mx.LookupURLHostParallel(ctx, parsed, resolvers...) {
|
||||
const parallelism = 3
|
||||
for dns := range mx.LookupURLHostParallel(ctx, parallelism, parsed, resolvers...) {
|
||||
m.DNS = append(m.DNS, dns)
|
||||
}
|
||||
```
|
||||
|
|
@ -102,7 +103,7 @@ The rest of the program is exactly like in chapter09.
|
|||
httpEndpoints, err := measurex.AllHTTPEndpointsForURL(parsed, headers, m.DNS...)
|
||||
runtimex.PanicOnError(err, "cannot get all the HTTP endpoints")
|
||||
cookies := measurex.NewCookieJar()
|
||||
for epnt := range mx.HTTPEndpointGetParallel(ctx, cookies, httpEndpoints...) {
|
||||
for epnt := range mx.HTTPEndpointGetParallel(ctx, parallelism, cookies, httpEndpoints...) {
|
||||
m.Endpoints = append(m.Endpoints, epnt)
|
||||
}
|
||||
print(m)
|
||||
|
|
|
|||
Loading…
Reference in a new issue