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

◆ cancel()

void MayaFlux::Kriya::EventChain::cancel ( )

Cancels the event chain if it's currently executing.

Terminates the underlying coroutine, preventing any remaining events from executing. Safe to call even if chain has completed.

Definition at line 147 of file Chain.cpp.

148{
149 if (!is_active()) {
150 return;
151 }
152
153 auto routine = std::exchange(m_routine, nullptr);
154 routine->set_should_terminate(true);
155 m_Scheduler.cancel_task(routine);
156}
Vruta::TaskScheduler & m_Scheduler
Reference to the scheduler that manages timing.
Definition Chain.hpp:189
std::shared_ptr< Vruta::Routine > m_routine
The underlying computational routine that implements the chain.
Definition Chain.hpp:206
bool is_active() const
Checks if the event chain is currently active.
Definition Chain.cpp:158
bool cancel_task(const std::shared_ptr< Routine > &routine)
Cancels and removes a task from the scheduler.

References MayaFlux::Vruta::TaskScheduler::cancel_task(), is_active(), m_routine, and m_Scheduler.

+ Here is the call graph for this function: