MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ await_suspend()

template<typename T >
bool MayaFlux::Kriya::BroadcastAwaiter< T >::await_suspend ( std::coroutine_handle<>  handle)
inline

Register with the source and suspend, or consume a pending value that arrived in the race window and return false (no suspend).

Parameters
handleCoroutine handle.
Returns
true if the coroutine should suspend, false if it should continue.

Definition at line 84 of file BroadcastAwaiter.hpp.

85 {
86 m_handle = handle;
87 m_is_suspended = true;
88 m_source.register_waiter(this);
89
90 if (auto val = m_source.pop_pending()) {
91 m_source.unregister_waiter(this);
92 m_result = std::move(*val);
93 m_is_suspended = false;
94 return false;
95 }
96
97 return true;
98 }
Vruta::BroadcastSource< T > & m_source
std::coroutine_handle m_handle

References MayaFlux::Kriya::EventAwaiter::m_handle, MayaFlux::Kriya::EventAwaiter::m_is_suspended, MayaFlux::Kriya::BroadcastAwaiter< T >::m_result, and MayaFlux::Kriya::BroadcastAwaiter< T >::m_source.