You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eg. call rpc with timeout using stop_when, and retry:
int retryCount = 5;
while (retryCount > 0) {
-- retryCount;
auto result = co_awaitdone_as_optional(stop_when(fakeRpc(), s.schedule_after(2s)));
if (result) {
std::cout << "Task done with " << *result << std::endl;
co_return *result;
} else {
std::cout << "Retry..." << std::endl;
}
}
But if this coroutine is canceled outside by stop_source, stop_when is canceled, and several retries run instantly.
How to tell if canceled by stop_when?
The text was updated successfully, but these errors were encountered:
vrecluse
changed the title
How to distinguish cancellation from stop_when and ouside?
How to distinguish between cancellation from stop_when and ouside?
Sep 7, 2023
eg. call rpc with timeout using stop_when, and retry:
But if this coroutine is canceled outside by stop_source, stop_when is canceled, and several retries run instantly.
How to tell if canceled by stop_when?
The text was updated successfully, but these errors were encountered: