[SERVER-52916] Add ExecutorFuture-returning TaskExecutor::sleepUntil/For Created: 17/Nov/20  Updated: 29/Oct/23  Resolved: 19/Nov/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Matthew Saltz (Inactive) Assignee: Matthew Saltz (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Service arch 2020-11-30
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 18/Nov/20 ]

Author:

{'name': 'Matthew Saltz', 'email': 'matthew.saltz@mongodb.com', 'username': 'saltzm'}

Message: SERVER-52916 Add futurized TaskExecutor::sleepUntil
Branch: master
https://github.com/mongodb/mongo/commit/875cccb1375d07991dae89793a096d0eab123b11

Generated at Thu Feb 08 05:29:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.