configuring progress messages
it appears that there are three ways to enable/disable progress messages:
req_progress()allows you to enable progress messages and specify a direction, but does not allow you to disable them.req_options(noprogress = TRUE)looks like it can disable progress messages, but it is unclear asreq_options()documentation states that these arecurloptions, nothttr2options.req_perform_*()functions (e.g.,req_perform_paralle()) have a booleanprogressargument.
It is unclear how these options interact. It appears that req_progress() is just a wrapper around req_options(noprogress = FALSE), but the documentation specifies that req_options() is for configuring curl options rather than httr2 options. It also appears that the progress argument to the multi-request functions req_perform_*() is a separate progress bar for the request batch, and unrelated to the progress bar for individual requests (so you could end up with nested progress bars, or disable the progress for the request batch but not the individual requests, or vice versa).
I have two suggestions:
- Add support
req_progress(type = "none")so that request progress can be enabled/disabled from a single entry point, rather than requiringreq_options()to disable andreq_progress()to enable. - Clarify the documentation on the
progressargument to multiple request functions to differentiate it fromreq_progress().
Why do you want to disable the progress bar? (Rather than just failing to enable it?)
I'm a bit leery of adding a way to turn it off because I think that would imply the need for a bunch of other tools to suppress the actions that other req_ functions have taken.
If the default is always for no progress messages then (1) is not needed. I was getting intermittent test errors because messages were occasionally being thrown, but on further inspection this may have been the parallel/iterative progress message rather than the request progress message. Note that req_perform_*() functions have progress = TRUE by default.
Hmmmm, we should probably suppress those by default in tests, since it's a bit easier for do it centrally in httr2 rather than in every package that wraps it.
I'll also clarify the difference in the progress bars to the docs: req_progress() adds a progress bar for the download of an individual request; the progress argument to req_perform_parallel() and friends gives the progress across all requests. I should also note that you can't use them together.