-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
TaskExecutor predates the introduction of Future in the server codebase, so it provides a (what is now) nonstandard API that accepts callbacks as arguments and returns CallbackHandle, which allows the caller to join on the task's completion or cancel it. Today, this functionality is provided through Futures and CancellationToken, so there is no need to maintain the older API. TaskExecutor does currently offers a Future-returning API which is based on the CallbackHandle-returning one, but has a bit of overhead which could be avoided once the Future-based API was the only one. Standardizing on Future also helps promote uniformity in async programming across the server.
Furthermore, the internals of ThreadPoolTaskExecutor, the main non-proxying TaskExecutor implementation, and its subcomponent NetworkInterfaceTL were rewritten to use Futures and CancellationTokens as part of SPM-3750, so dropping the non-Future based API would simplify ThreadPoolTaskExecutor's implementation.
- related to
-
SERVER-95281 Remove NetworkInterface's usage of TaskExecutor::CallbackHandle
- Open