Adding global timeout outside of the API call implementation;
Stopping polling in case of any issue - delegating retry logic to the application;
Overall this changeset tries to consolidate all potential errors that could happen during the polling process and delegate their handling to a user application (maybe I am missing some potential use-cases for a library-level retry and circuit-breaking logic).
The way tests are handled can be improved if this issue gets resolved.
Overall this changeset tries to consolidate all potential errors that could happen during the polling process and delegate their handling to a user application (maybe I am missing some potential use-cases for a library-level retry and circuit-breaking logic). The way tests are handled can be improved if this issue gets resolved.