tenzr::execution::StreamEventState¶
Shared readiness state for a stream event, holding the ready flag, the PJRT event, and completion callbacks.
#include <stream.h>
Public Functions¶
| Name | |
|---|---|
| void | SetReady() Mark the event ready and dispatch registered callbacks. |
| void | Wait() Block until the event is ready. |
| bool | IsReady() const Check readiness without blocking. |
| void | AddCallback(std::function< void()> cb) Register a callback to run on completion. |
Public Attributes¶
| Name | |
|---|---|
| std::atomic< bool > | ready |
| std::mutex | mutex |
| std::condition_variable | cv |
| std::vector< std::function< void()> > | callbacks Callbacks invoked on completion. |
| PJRT_Event * | pjrt_event |
Public Functions Documentation¶
function SetReady¶
Mark the event ready and dispatch registered callbacks.
Mark the event ready and run all registered callbacks.
function Wait¶
Block until the event is ready.
Block until the event becomes ready.
function IsReady¶
Check readiness without blocking.
Return: true when ready.
Whether the event has already fired.
function AddCallback¶
Register a callback to run on completion.
Parameters:
- cb Callback to run on readiness.
Register a callback, invoking it immediately when the event is already ready.
Public Attributes Documentation¶
variable ready¶
variable mutex¶
variable cv¶
variable callbacks¶
Callbacks invoked on completion.