Skip to content

EntropyEngine::Core::Concurrency::WorkGraphEvent

EntropyEngine::Core::Concurrency::WorkGraphEvent

Section titled “EntropyEngine::Core::Concurrency::WorkGraphEvent”

The mother of all WorkGraph events - timestamp and source. More…

#include <WorkGraphEvents.h>

Inherited by EntropyEngine::Core::Concurrency::DependencyAddedEvent, EntropyEngine::Core::Concurrency::DependencyResolvedEvent, EntropyEngine::Core::Concurrency::GraphExecutionCompletedEvent, EntropyEngine::Core::Concurrency::GraphExecutionStartedEvent, EntropyEngine::Core::Concurrency::GraphStatsEvent, EntropyEngine::Core::Concurrency::NodeAddedEvent, EntropyEngine::Core::Concurrency::NodeCancelledEvent, EntropyEngine::Core::Concurrency::NodeCompletedEvent, EntropyEngine::Core::Concurrency::NodeDeferredEvent, EntropyEngine::Core::Concurrency::NodeExecutingEvent, EntropyEngine::Core::Concurrency::NodeFailedEvent, EntropyEngine::Core::Concurrency::NodeReadyEvent, EntropyEngine::Core::Concurrency::NodeScheduledEvent, EntropyEngine::Core::Concurrency::NodeStateChangedEvent

Name
WorkGraphEvent(const WorkGraph * g)
Name
std::chrono::steady_clock::time_pointtimestamp
When this event was created.
const WorkGraph *graph
Which graph emitted this event.
struct EntropyEngine::Core::Concurrency::WorkGraphEvent;

The mother of all WorkGraph events - timestamp and source.

Every event carries these two essential pieces of information: when it happened and which graph it came from. The timestamp uses steady_clock for reliable duration measurements even if the system clock changes.

Minimal overhead design.

// All events inherit from this, so you can handle them generically
eventBus->subscribe<WorkGraphEvent>([](const WorkGraphEvent& event) {
auto elapsed = std::chrono::steady_clock::now() - event.timestamp;
LOG_DEBUG("Event from graph {} occurred {}ms ago",
event.graph,
std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count());
});
inline explicit WorkGraphEvent(
const WorkGraph * g
)
std::chrono::steady_clock::time_point timestamp;

When this event was created.

const WorkGraph * graph;

Which graph emitted this event.


Updated on 2026-01-26 at 17:14:35 -0500