Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
SyncExecutionContext.hpp
1#pragma once
2
3#include "util/async/context/BasicExecutionContext.hpp"
4#include "util/async/context/SystemExecutionContext.hpp"
5#include "util/async/context/impl/Cancellation.hpp"
6
7#include <boost/asio/error.hpp>
8
9#include <cstddef>
10
11namespace util::async {
12namespace impl {
13
15 struct Executor {
16 Executor(std::size_t)
17 {
18 }
19
20 void
21 stop() const noexcept
22 {
23 }
24
25 void
26 join() const noexcept
27 {
28 }
29 };
30
31 // Note: these types are not actually used but needed for compilation
32 struct Timer {};
33 struct Strand {
34 struct Executor {};
35 struct Timer {};
36 };
37
38 Executor executor;
39
40 void
41 stop() const noexcept
42 {
43 executor.stop();
44 }
45
46 void
47 join() const noexcept
48 {
49 executor.join();
50 }
51
52 Executor&
53 getExecutor()
54 {
55 return executor;
56 }
57
58 [[nodiscard]] Strand
59 makeStrand() noexcept // NOLINT(readability-convert-member-functions-to-static)
60 {
61 return {};
62 }
63};
64
66 template <typename CtxType>
67 [[nodiscard]] static constexpr auto&
68 getContext([[maybe_unused]] CtxType& self) noexcept
69 {
71 }
72};
73
74} // namespace impl
75
90
91} // namespace util::async
A highly configurable execution context.
Definition BasicExecutionContext.hpp:114
static auto & instance()
Get the instance of the system execution context.
Definition SystemExecutionContext.hpp:21
Definition Cancellation.hpp:86
This namespace implements an async framework built on top of execution contexts.
Definition AnyExecutionContext.hpp:17
BasicExecutionContext< impl::SameThreadContext, impl::BasicStopSource, impl::SyncDispatchStrategy, impl::SystemContextProvider > SyncExecutionContext
A synchronous execution context. Runs on the caller thread.
Definition SyncExecutionContext.hpp:85
Definition SyncExecutionContext.hpp:15
Definition SyncExecutionContext.hpp:34
Definition SyncExecutionContext.hpp:35
Definition SyncExecutionContext.hpp:33
Definition SyncExecutionContext.hpp:32
Definition SyncExecutionContext.hpp:14
Definition Execution.hpp:91
Definition SyncExecutionContext.hpp:65