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

Add ExecutorFuture-returning TaskExecutor::sleepUntil/For

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Service arch 2020-11-30

      The API should be as follows.

      ExecutorFuture<void> sleepUntil(Date_t when, const CancelationToken& token);
      

      The pattern

      CancelationSource cancelSource;
      auto execFuture = sleepUntil(deadline, cancelSource.token())
          .then([] {
              // Do stuff
          });
      

      will replace usages of TaskExecutor::scheduleWorkAt

            Assignee:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Reporter:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: