Condy v1.9
C++ Asynchronous System Call Layer for Linux
Loading...
Searching...
No Matches
execution.hpp
Go to the documentation of this file.
1
5
6#pragma once
7
9
10#ifdef CONDY_DETAIL_HAS_EXECUTION
11
13#include "condy/runtime.hpp"
14#include <utility>
15
16namespace condy {
17
23class Scheduler : public detail::Scheduler {
24private:
25 friend Scheduler get_scheduler(Runtime &);
26
27 Scheduler(Runtime &runtime) : detail::Scheduler(runtime) {}
28};
29
33inline Scheduler get_scheduler(Runtime &runtime) { return Scheduler{runtime}; }
34
43template <typename Sender> auto wait_sender(Sender &&sender) {
44 auto &runtime = current_runtime();
45 auto s = std::forward<Sender>(sender) | detail::ex::affine();
46 return detail::WaitSenderAwaiter<decltype(s)>(std::move(s), runtime);
47}
48
49} // namespace condy
50
51#endif
The event loop runtime for executing asynchronous.
Definition runtime.hpp:36
Internal sender/receiver adapters for std::execution integration.
Detection and aliasing of the available std::execution backend.
The main namespace for the Condy library.
Definition condy.hpp:38
auto & current_runtime() noexcept
Get the current runtime.
Definition runtime.hpp:452
Runtime type for running the io_uring event loop.