proxygen
|
Namespaces | |
detail | |
Classes | |
struct | await_result |
struct | await_result< Awaitable, std::enable_if_t< is_awaitable_v< Awaitable > > > |
class | AwaitableReady |
class | AwaitableReady< void > |
struct | awaiter_type |
struct | awaiter_type< Awaitable, std::enable_if_t< is_awaitable_v< Awaitable > > > |
class | Baton |
struct | getCurrentExecutor |
struct | is_awaitable |
struct | is_awaiter |
class | Mutex |
class | Task |
class | TaskWithExecutor |
class | TimedWaitAwaitable |
class | ViaIfAsyncAwaitable |
class | ViaIfAsyncAwaiter |
class | Wait |
Typedefs | |
template<typename Awaitable > | |
using | awaiter_type_t = typename awaiter_type< Awaitable >::type |
template<typename Awaitable > | |
using | await_result_t = typename await_result< Awaitable >::type |
Functions | |
template<typename Awaitable > | |
auto | blockingWait (Awaitable &&awaitable) -> detail::decay_rvalue_reference_t< await_result_t< Awaitable >> |
template<typename Awaitable , std::enable_if_t< folly::Conjunction< is_awaiter< Awaitable >, folly::Negation< detail::_has_free_operator_co_await< Awaitable >>, folly::Negation< detail::_has_member_operator_co_await< Awaitable >>>::value, int > = 0> | |
Awaitable & | get_awaiter (Awaitable &&awaitable) |
template<typename Awaitable , std::enable_if_t< detail::_has_member_operator_co_await< Awaitable >::value, int > = 0> | |
decltype(auto) | get_awaiter (Awaitable &&awaitable) |
template<typename Awaitable > | |
TimedWaitAwaitable< std::decay_t< Awaitable > > | timed_wait (Awaitable &&awaitable, std::chrono::milliseconds duration) |
template<typename Awaitable > | |
auto | operator co_await (ViaIfAsyncAwaitable< Awaitable > &&awaitable) -> ViaIfAsyncAwaiter< folly::coro::awaiter_type_t< Awaitable >> |
template<typename Awaitable > | |
auto | operator co_await (ViaIfAsyncAwaitable< Awaitable > &awaitable) -> ViaIfAsyncAwaiter< folly::coro::awaiter_type_t< Awaitable & >> |
template<typename Awaitable > | |
auto | operator co_await (const ViaIfAsyncAwaitable< Awaitable > &&awaitable) -> ViaIfAsyncAwaiter< folly::coro::awaiter_type_t< const Awaitable && >> |
template<typename Awaitable > | |
auto | operator co_await (const ViaIfAsyncAwaitable< Awaitable > &awaitable) -> ViaIfAsyncAwaiter< folly::coro::awaiter_type_t< const Awaitable & >> |
template<typename Awaitable > | |
auto | co_viaIfAsync (folly::Executor *executor, Awaitable &&awaitable) -> ViaIfAsyncAwaitable< Awaitable > |
Variables | |
template<typename T > | |
constexpr bool | is_awaiter_v = is_awaiter<T>::value |
template<typename T > | |
constexpr bool | is_awaitable_v = is_awaitable<T>::value |
using folly::coro::await_result_t = typedef typename await_result<Awaitable>::type |
using folly::coro::awaiter_type_t = typedef typename awaiter_type<Awaitable>::type |
auto folly::coro::blockingWait | ( | Awaitable && | awaitable | ) | -> detail::decay_rvalue_reference_t<await_result_t<Awaitable>> |
blockingWait(Awaitable&&) -> await_result_t<Awaitable>
This function co_awaits the passed awaitable object and blocks the current thread until the operation completes.
This is useful for launching an asynchronous operation from the top-level main() function or from unit-tests.
WARNING: Avoid using this function within any code that might run on the thread of an executor as this can potentially lead to deadlock if the operation you are waiting on needs to do some work on that executor in order to complete.
Definition at line 313 of file BlockingWait.h.
References folly::coro::detail::makeRefBlockingWaitTask().
auto folly::coro::co_viaIfAsync | ( | folly::Executor * | executor, |
Awaitable && | awaitable | ||
) | -> ViaIfAsyncAwaitable<Awaitable> |
Returns a new awaitable that will resume execution of the awaiting coroutine on a specified executor in the case that the operation does not complete synchronously.
If the operation completes synchronously then the awaiting coroutine will continue execution on the current thread without transitioning execution to the specified executor.
Definition at line 247 of file ViaIfAsync.h.
References folly::pushmi::executor.
Referenced by folly::coro::detail::TaskPromiseBase::await_transform(), folly::Future< folly::folly::Unit >::semi(), and folly::SemiFuture< T >::within().
Awaitable& folly::coro::get_awaiter | ( | Awaitable && | awaitable | ) |
get_awaiter(Awaitable&&) -> awaiter_type_t<Awaitable>
The get_awaiter() function takes an Awaitable type and returns a value that contains the await_ready(), await_suspend() and await_resume() methods for that type.
This encapsulates calling 'operator co_await()' if it exists.
Definition at line 138 of file Traits.h.
Referenced by get_awaiter().
decltype(auto) folly::coro::get_awaiter | ( | Awaitable && | awaitable | ) |
Definition at line 147 of file Traits.h.
References get_awaiter(), and folly::value().
auto folly::coro::operator co_await | ( | ViaIfAsyncAwaitable< Awaitable > && | awaitable | ) | -> ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<Awaitable>> |
Definition at line 211 of file ViaIfAsync.h.
auto folly::coro::operator co_await | ( | ViaIfAsyncAwaitable< Awaitable > & | awaitable | ) | -> ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<Awaitable&>> |
Definition at line 218 of file ViaIfAsync.h.
auto folly::coro::operator co_await | ( | const ViaIfAsyncAwaitable< Awaitable > && | awaitable | ) | -> ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<const Awaitable&&>> |
Definition at line 225 of file ViaIfAsync.h.
auto folly::coro::operator co_await | ( | const ViaIfAsyncAwaitable< Awaitable > & | awaitable | ) | -> ViaIfAsyncAwaiter<folly::coro::awaiter_type_t<const Awaitable&>> |
Definition at line 233 of file ViaIfAsync.h.
TimedWaitAwaitable<std::decay_t<Awaitable> > folly::coro::timed_wait | ( | Awaitable && | awaitable, |
std::chrono::milliseconds | duration | ||
) |
constexpr bool folly::coro::is_awaitable_v = is_awaitable<T>::value |
constexpr bool folly::coro::is_awaiter_v = is_awaiter<T>::value |