Allow setting custom retries number/timeout/ssl settings for connectors.
Pilipets opened this issue · 1 comments
There are various reasons when sending requests are gonna fail - the idea of this suggestion is allowing low-level retries/timeouts for HTTP requests if possible on the bundle.
Also, I noticed, that SSL is enabled in boost::beast by default, though disabled in CPR (the CPR allows it) - uniform behavior is expected, in my opinion. Enabling/disabling SSL configurations will be a valuable addition.
When creating the connector, one can specify those connection parameters.
connector::cpr_blocking_monadic connector(token); // for simple usage as it's now
connector::cpr_blocking_monadic connector(config); // here config is CPR-related class, which allows advanced configuring.
Looks like httplib, CPR already supports timeouts - https://github.com/yhirose/cpp-httplib, https://github.com/whoshuu/cpr; in boost/beast you are setting 30 seconds as constants.
Regarding retries, one might say the programmer should handle it on the upper level. Indeed one can, but won't it create a performance overhead because of the serialization/deserialization taking place?
I'll add setters to all connectors (SSL, timeouts, etc..)
Regarding retries, one might say the programmer should handle it on the upper level. Indeed one can, but won't it create a performance overhead because of the serialization/deserialization taking place?
That's a good point. We need a way to pass pre-serialized arguments.