Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-51298

Add cancelation support to AsyncTry/until/withDelayBetweenIterations

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.9.0
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Service arch 2020-12-28
    • 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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              george.wangensteen George Wangensteen
              Reporter:
              matthew.saltz Matthew Saltz
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: