25 #include <experimental/coroutine> 26 #include <type_traits> 42 template <
typename Promise>
44 std::experimental::coroutine_handle<Promise> coro)
noexcept {
81 result_->emplaceException(
89 std::is_nothrow_constructible<
T, U&&>::
value) {
90 result_->emplace(static_cast<U&&>(value));
96 std::experimental::coroutine_handle<BlockingWaitPromise<T>>::from_promise(
104 return getAsTry().value();
111 template <
typename T>
121 result_->emplaceException(
126 result_->emplace(std::ref(
value));
131 result_->emplace(std::ref(
value));
136 void return_value(
T&
value) noexcept {
137 result_->emplace(std::ref(value));
152 std::experimental::coroutine_handle<BlockingWaitPromise<T&>>::from_promise(
160 return getAsTry().value();
177 result_->emplaceException(
184 std::experimental::coroutine_handle<
192 return getAsTry().
value();
199 template <
typename T>
203 using handle_t = std::experimental::coroutine_handle<promise_type>;
218 decltype(
auto) getAsTry() && {
219 return coro_.promise().getAsTry();
223 return coro_.promise().get();
230 template <
typename T>
234 std::experimental::coroutine_handle<BlockingWaitPromise<T>>::from_promise(
238 template <
typename T>
251 template <
typename T>
256 template <
typename T>
259 template <
typename T>
268 co_return co_await
static_cast<Awaitable&&
>(awaitable);
277 co_yield co_await
static_cast<Awaitable&&
>(awaitable);
285 co_await
static_cast<Awaitable&&
>(awaitable);
294 co_yield co_await
static_cast<Awaitable&&
>(awaitable);
312 template <
typename Awaitable>
315 return static_cast<std::add_rvalue_reference_t<await_result_t<Awaitable>
>>(
folly::Try< std::reference_wrapper< T > > * result_
folly::Try< void > getAsTry()
folly::Try< T > * result_
void await_suspend(std::experimental::coroutine_handle< Promise > coro) noexcept
auto yield_value(T &value) noexcept
folly::fibers::Baton baton_
BlockingWaitTask(BlockingWaitTask &&other) noexcept
static exception_wrapper from_exception_ptr(std::exception_ptr const &eptr) noexcept
void return_void() noexcept
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
typename await_result< Awaitable >::type await_result_t
auto yield_value(T &&value) noexcept
std::experimental::suspend_always initial_suspend()
FinalAwaiter final_suspend() noexcept
BlockingWaitTask(handle_t coro) noexcept
void return_value(U &&value) noexcept(std::is_nothrow_constructible< T, U && >::value)
static const char *const value
void await_resume() noexcept
typename decay_rvalue_reference< T >::type decay_rvalue_reference_t
BlockingWaitPromiseBase() noexcept=default
T exchange(T &obj, U &&new_value)
folly::Try< T > getAsTry()
std::experimental::coroutine_handle< promise_type > handle_t
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
BlockingWaitTask< void > makeRefBlockingWaitTask(Awaitable &&awaitable)
auto makeBlockingWaitTask(Awaitable &&awaitable) -> BlockingWaitTask< decay_rvalue_reference_t< Result >>
BlockingWaitTask< T > get_return_object() noexcept
void unhandled_exception() noexcept
bool await_ready() noexcept
folly::Try< void > * result_
PUSHMI_INLINE_VAR constexpr detail::get_fn< T > get
void unhandled_exception() noexcept
void unhandled_exception() noexcept
auto blockingWait(Awaitable &&awaitable) -> detail::decay_rvalue_reference_t< await_result_t< Awaitable >>
folly::Try< std::reference_wrapper< T > > getAsTry()