Struct zenoh_flow_nodes::prelude::OutputRaw
source · pub struct OutputRaw { /* private fields */ }Expand description
An OutputRaw sends LinkMessage or Into<Payload> to downstream nodes.
Its primary purpose is to ensure optimal performance: any message received on an input can transparently be sent downstream, without requiring (a potentially expensive) access to the data it contained.
Implementations§
source§impl OutputRaw
impl OutputRaw
sourcepub fn channels_count(&self) -> usize
pub fn channels_count(&self) -> usize
Returns the number of channels associated with this Output.
sourcepub fn try_send(
&self,
payload: impl Into<Payload>,
timestamp: Option<u64>
) -> Result<()>
pub fn try_send( &self, payload: impl Into<Payload>, timestamp: Option<u64> ) -> Result<()>
Attempt to send, synchronously, the data on all channels to the downstream Nodes.
If no timestamp is provided, the current timestamp (as per the HLC used by
the Zenoh-Flow daemon running this Node) is taken.
§Asynchronous alternative: send
This method is a synchronous fail-fast alternative to its asynchronous counterpart: send.
Hence, although synchronous, this method will not block the thread on which it is executed.
§Errors
If an error occurs while sending the watermark on a channel, Zenoh-Flow still tries to send it on the remaining channels. For each failing channel, an error is logged and counted for.
sourcepub async fn forward(&self, message: LinkMessage) -> Result<()>
pub async fn forward(&self, message: LinkMessage) -> Result<()>
Forward, asynchronously, the LinkMessage on all channels to the downstream Nodes.
§Errors
If an error occurs while sending the message on a channel, Zenoh-Flow still tries to send it on the remaining channels. For each failing channel, an error is logged and counted for.
sourcepub async fn send(
&self,
payload: impl Into<Payload>,
timestamp: Option<u64>
) -> Result<()>
pub async fn send( &self, payload: impl Into<Payload>, timestamp: Option<u64> ) -> Result<()>
Send, asynchronously, the data on all channels to the downstream Nodes.
If no timestamp is provided, the current timestamp — as per the HLC used by
the Zenoh-Flow daemon running this Node — is taken.
§Errors
If an error occurs while sending the watermark on a channel, Zenoh-Flow still tries to send it on the remaining channels. For each failing channel, an error is logged and counted for.