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

◆ on_complete()

void MayaFlux::Vruta::Event::on_complete ( std::function< void()>  callback)
inline

Register a callback fired once when the handler ends.

Parameters
callbackFunction to invoke on completion

Fires on the first of: the handler coroutine reaching its end, or a termination request (cancel, removal, replacement by name, terminate-all). It is once-only per handler, not per event. It runs on the thread that ends the handler, which for natural completion is the producer thread that resumed it (possibly the audio thread). Register before adding the event; a callback registered after completion runs immediately.

The stock handlers (key, mouse, network and broadcast listeners) loop until cancelled, so for them this only reports removal. A cancelled handler whose Event is still held by the caller stays parked on its source and may run its per-event callback once more on the next matching input.

Definition at line 142 of file Event.hpp.

143 {
144 m_handle.promise().on_complete(std::move(callback));
145 }
PickCallback callback
Definition Picker.cpp:22
std::coroutine_handle< promise_type > m_handle
Definition Event.hpp:244

References callback.