[SERVER-51298] Add cancelation support to AsyncTry/until/withDelayBetweenIterations Created: 01/Oct/20 Updated: 29/Oct/23 Resolved: 16/Dec/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Matthew Saltz (Inactive) | Assignee: | George Wangensteen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Service arch 2020-12-28 | ||||||||||||
| Participants: | |||||||||||||
| Story Points: | 2 | ||||||||||||
| Description |
|
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. |
| Comments |
| Comment by Githook User [ 10/Dec/20 ] |
|
Author: {'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}Message: |