simvx.core.helpers.coroutines

Coroutine helpers: parallel, wait, wait_until, wait_signal, next_frame.

Module Contents

Functions

parallel

Run multiple coroutines simultaneously, finish when all complete.

wait

Pause a coroutine for given seconds.

wait_until

Yield until condition() returns True.

wait_signal

Yield until signal is emitted. Returns signal args.

next_frame

Yield for exactly one frame.

API

simvx.core.helpers.coroutines.parallel(*coroutines: simvx.core.descriptors.Coroutine) simvx.core.descriptors.Coroutine[source]

Run multiple coroutines simultaneously, finish when all complete.

simvx.core.helpers.coroutines.wait(seconds: float) simvx.core.descriptors.Coroutine[source]

Pause a coroutine for given seconds.

simvx.core.helpers.coroutines.wait_until(condition: collections.abc.Callable[[], bool]) simvx.core.descriptors.Coroutine[source]

Yield until condition() returns True.

simvx.core.helpers.coroutines.wait_signal(signal: simvx.core.descriptors.Signal) simvx.core.descriptors.Coroutine[source]

Yield until signal is emitted. Returns signal args.

simvx.core.helpers.coroutines.next_frame() simvx.core.descriptors.Coroutine[source]

Yield for exactly one frame.