Get or set the maximum number of concurrent HTTP range requests that can be performed per second in downloadDatabaseRanges. Setting this to a smaller number avoids excessive load on the server.

rangeConcurrency(concurrency = NULL)

Arguments

concurrency

Integer containing the maximum number of concurrent requests per second.

Value

If concurrency=NULL, the maximum number of concurrent requests is returned.

If concurrency is provided, it is set to the maximum number of concurrent requests, and the previous maximum is returned.

See also

req_throttle, for the logic behind the requests-per-second limit.

Author

Aaron Lun

Examples

rangeConcurrency()
#> [1] 10
old <- rangeConcurrency(5)
rangeConcurrency()
#> [1] 5
rangeConcurrency(old)
rangeConcurrency()
#> [1] 10