nxtio/async-core.hpp file

Namespaces

namespace nxt

Typedefs

using event = coro::event
Manually signaled coroutine event.
template <typename T>
using generator = coro::generator<T>
Coroutine generator type.
using io_scheduler = scheduler
using latch = coro::latch
Coroutine latch primitive.
using poll_op = coro::poll_op
Poll operation type from libcoro.
using poll_status = coro::poll_status
Poll status type from libcoro.
using poll_stop_source = coro::poll_stop_source
Stop source for cancellable poll operations.
template <typename T>
using queue = coro::queue<T>
Async multi-producer/multi-consumer queue.
using scheduler = coro::scheduler
Scheduler type used by nxt async operations.
template <std::ptrdiff_t max_value>
using semaphore = coro::semaphore<max_value>
Counting semaphore with a compile-time maximum value.
template <typename T = void>
using task = coro::task<T>
Coroutine task type used throughout nxt.

Functions

auto start(scheduler& sched, task<> t) →  auto
auto sync_wait(auto&& awaitable) →  auto
Run an awaitable synchronously on the current thread.
auto when_all(auto&& tasks) →  auto
Await a collection of tasks.
auto when_all(auto&& first, auto&& second, auto && ... rest) →  auto
Await several awaitables.