9 return Event { std::coroutine_handle<event_promise>::from_promise(*
this) };
17 "Event: Invalid coroutine handle");
46 : m_handle(std::exchange(other.m_handle, {}))
53 if (m_handle && m_handle.address())
56 m_handle = std::exchange(other.m_handle, {});
72 return m_handle.promise().processing_token;
86 m_handle.promise().state[key] = std::move(value);
96 auto& state_map =
m_handle.promise().state;
97 auto it = state_map.find(key);
98 if (it != state_map.end()) {
virtual ProcessingToken get_processing_token() const
Get the processing token that determines how this routine should be scheduled.
virtual bool is_active() const
Checks if the coroutine is still active.
virtual ~Event()
Destructor.
virtual void * get_state_impl_raw(const std::string &key)
std::coroutine_handle< promise_type > m_handle
Event & operator=(const Event &other)
Copy assignment operator.
Event(std::coroutine_handle< promise_type > h)
Constructs a Event from a coroutine handle.
virtual void set_state_impl(const std::string &key, std::any value)
std::coroutine_handle< promise_type > get_handle() const
Coroutine type for event-driven suspension.
@ EventDispatch
Event dispatching and coordination.
@ Vruta
Coroutines, schedulers, clocks, task management.
@ ON_DEMAND
Coroutine is executed on demand, not scheduled.
Event get_return_object()