-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
Service arch 2020-12-28
-
2
The asynchronous looping utility AsyncTry supports the ability to wait in between iterations for some amount of time. This wait should be cancelable with CancelationTokens. One way to do that would be to add a CancelationToken to these function signatures, and then instead of future_util::sleepUntil, use TaskExecutor::sleepUntil which accepts CancelationTokens.
Another would be to add a withCancelation function, but then that raises a question of when it should be possible to add this and whether we should always check it along with shouldStopIteration. I'm inclined to go the first route since it's easy enough to check the cancelation token in the until clause if the user wants to do that, and this is mainly to be able to cancel that deadline.
- depends on
-
SERVER-51284 Add variant of TaskExecutor::scheduleWork that accepts CancelationTokens
- Closed
- is depended on by
-
SERVER-50342 Make version of Shard::runCommand that returns a future
- Open