[SERVER-59862] Promote PromiseAndFuture to a first-class struct Created: 09/Sep/21  Updated: 29/Oct/23  Resolved: 16/Sep/21

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Related
is related to SERVER-48735 Document Server-Internal Promise-Futures Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2021-09-20
Participants:
Linked BF Score: 35

 Description   

Just take this private thing defined inside a function in future.h:

        struct PromiseAndFuture {
            Promise<T> promise = Promise(make_intrusive<SharedStateT>());
            Future<T> future = promise.getFuture();
        };

And move it basically to be in the mongo namespace.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 16/Sep/21 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-59862 PromiseAndFuture comment revision
Branch: master
https://github.com/mongodb/mongo/commit/0ed651b8a8fccd5e7f550d316ee3ee0860b942ae

Comment by Githook User [ 14/Sep/21 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-59862 give PromiseFuture a name
Branch: master
https://github.com/mongodb/mongo/commit/9a31793b88af8c10385fd5f5c303e22a37f28249

Comment by Billy Donahue [ 10/Sep/21 ]

This came up while trying to document the Future API

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