![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Hooks related to the lifecycle of graph objects (nodes and channels). More...
#include <dfx-hooks/Graph.hpp>
Public Member Functions | |
| virtual void | onNodeCreated (Core::NodePtr node)=0 |
| Called after a node has been created and is known to the runtime. | |
| virtual void | onNodeRemoved (Core::NodePtr node)=0 |
| Called when a node is being removed from the graph. | |
| virtual void | onChannelCreated (Core::ChannelPtr channel)=0 |
| Called after a channel has been created and registered in the graph. | |
| virtual void | onChannelRemoved (Core::ChannelPtr channel)=0 |
| Called when a channel is being removed from the graph. | |
Hooks related to the lifecycle of graph objects (nodes and channels).
dfx supports dynamic graphs at runtime (nodes/channels may appear and disappear while the system is running). Graph hooks allow observers to react to these lifecycle events for:
This interface is invoked when graph-level objects are created/removed by the runtime:
The hook is intended for "side-band" observers. It should not perform heavy work on the calling thread. If expensive processing is needed (serialization, I/O, etc.), enqueue work to a dedicated worker thread. Any exception thrown by those callback will be catched, displayed in a logger and discarded using dfx::Utils::safeInvoke
|
pure virtual |
Called after a channel has been created and registered in the graph.
A channel represents a message transport path between ports (often an SPSC queue, but the concrete type is runtime-defined).
| channel | The newly created channel. |
Implemented in dfx::Pcapng::Capture, and dfx::Runtime::Scheduler.
|
pure virtual |
Called when a channel is being removed from the graph.
This callback indicates the channel is no longer part of the graph (or is in the process of being removed). It does not imply the channel’s queue is empty, nor does it imply that in-flight messages have been drained.
| channel | The channel being removed. |
Implemented in dfx::Pcapng::Capture, and dfx::Runtime::Scheduler.
|
pure virtual |
Called after a node has been created and is known to the runtime.
This callback indicates the runtime has constructed the node. It does not imply that:
| node | The newly created node. |
Implemented in dfx::Pcapng::Capture, and dfx::Runtime::Scheduler.
|
pure virtual |
Called when a node is being removed from the graph.
This callback indicates the node is no longer part of the graph (or is in the process of being removed). It does not necessarily mean the node object is about to be destroyed immediately; it only indicates graph membership/lifecycle.
| node | The node being removed. |
Implemented in dfx::Pcapng::Capture, and dfx::Runtime::Scheduler.