pub struct DataFlowInstance { /* private fields */ }
Expand description
A DataFlowInstance
keeps track of the parts of a data flow managed by the Zenoh-Flow runtime.
A DataFlowInstance
structure is thus local to a Zenoh-Flow runtime. For a data flow that spawns on multiple
runtimes, there will be one such structure at each runtime.
All instances will share the same record but their internal state will differ.
Implementations§
Source§impl DataFlowInstance
impl DataFlowInstance
Sourcepub async fn abort(&mut self, hlc: &HLC)
pub async fn abort(&mut self, hlc: &HLC)
Aborts the DataFlowInstance
.
The hlc is required to keep track of when this call was made.
Sourcepub fn state(&self) -> &InstanceState
pub fn state(&self) -> &InstanceState
Returns the state of this DataFlowInstance
.
Sourcepub fn status(&self, runtime_id: &RuntimeId) -> InstanceStatus
pub fn status(&self, runtime_id: &RuntimeId) -> InstanceStatus
Returns the status of this DataFlowInstance
.
This structure was intended as a way to retrieve and display information about the instance. This is what the
zfctl
tool leverages for its instance status
command.
Methods from Deref<Target = DataFlowRecord>§
Sourcepub fn instance_id(&self) -> &InstanceId
pub fn instance_id(&self) -> &InstanceId
Returns the unique identifier of this DataFlowRecord
.
§Performance
The id is internally stored behind an Arc
so there is limited overhead to cloning it.
Sourcepub fn name(&self) -> &Arc<str>
pub fn name(&self) -> &Arc<str>
Returns the name of the data flow from which this DataFlowRecord
was generated.
Sourcepub fn mapping(&self) -> &HashMap<RuntimeId, HashSet<NodeId>>
pub fn mapping(&self) -> &HashMap<RuntimeId, HashSet<NodeId>>
Returns the mapping of the data flow: which Zenoh-Flow runtime manages which set of nodes.
Sourcepub fn senders(&self) -> &HashMap<NodeId, SenderRecord>
pub fn senders(&self) -> &HashMap<NodeId, SenderRecord>
Returns the set of Senders of the data flow.
A Sender sends data, through a publication on Zenoh, to Receiver(s).
Sourcepub fn receivers(&self) -> &HashMap<NodeId, ReceiverRecord>
pub fn receivers(&self) -> &HashMap<NodeId, ReceiverRecord>
Sourcepub fn links(&self) -> &[LinkDescriptor]
pub fn links(&self) -> &[LinkDescriptor]
Returns the set of links of the data flow: how the nodes are connected.
Compared to links found in a FlattenedDataFlowDescriptor, the links in a DataFlowRecord have been updated to take into account the Sender and Receiver connecting the Zenoh-Flow runtimes.
Sourcepub fn sources(&self) -> &HashMap<NodeId, FlattenedSourceDescriptor>
pub fn sources(&self) -> &HashMap<NodeId, FlattenedSourceDescriptor>
Returns the set of Source(s) of the data flow.
A Source
will feed external data in the data flow to be processed by downstream nodes.
Sourcepub fn operators(&self) -> &HashMap<NodeId, FlattenedOperatorDescriptor>
pub fn operators(&self) -> &HashMap<NodeId, FlattenedOperatorDescriptor>
Returns the set of Operator(s) of the data flow.
An Operator
performs computation on the data it receives, either modifying it or producing new data that it
forwards to downstream nodes.