Adding DeferredExecutor to support deferred execution of tasks on a future returned...
authorLee Howes <lwh@fb.com>
Tue, 31 Oct 2017 21:20:08 +0000 (14:20 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 31 Oct 2017 21:23:59 +0000 (14:23 -0700)
commit6e7e5a64d39ea0f2ed11660f46c4ba4d926ff419
tree58b1eda2fab281417518921e7b7143b5c876f8aa
parent1071e66206f2eaa8f204762737413706c0adec6d
Adding DeferredExecutor to support deferred execution of tasks on a future returned from an interface.

Summary: This adds a DeferredExecutor type that is boostable, which means that it follows the expectation we expect for C++20 that .then and get will trigger boost-blocking behaviour and ensure work makes progress. Unlike discussions for C++ this adds boost blocking to folly only in the specific case of deferring work to run on the caller's executor, to avoid the necessity to pass an executor into a library purely to ensure that finalisation work and future completion occor on a well-defined exewcutor.

Reviewed By: yfeldblum

Differential Revision: D5828743

fbshipit-source-id: 9a4b69d7deaa33c3cecd6546651b99cc99f0c286
folly/Executor.h
folly/futures/Future-inl.h
folly/futures/Future-pre.h
folly/futures/Future.cpp
folly/futures/Future.h
folly/futures/test/SemiFutureTest.cpp