Skip to content

Node descriptors (master)

Gabriele Baldoni edited this page Mar 9, 2023 · 1 revision

Table of contents

  1. (optional) Vars
  2. (optional) Configuration
  3. Inputs and Outputs
  4. URI

Node descriptors tell Zenoh-Flow how a node can be connected and where its actual implementation can be found. The descriptors detail the following information:

  • an id --- this field is for display purposes when Zenoh-Flow will provide a registry,
  • (optional) some vars,
  • (optional) some configuration,
  • its input(s) --- only for an Operator and a Sink,
  • its output(s) --- only for a Source and an Operator,
  • a uri --- where the implementation of the node can be found.

Below is the descriptor of an Operator that we will use to explain each section. The only difference with Source and Sink descriptors is in their lack of inputs/outputs: (as indicated in the comments) a Source only has outputs while a Sink only has inputs.

id: my-operator

# (optional)
vars:
  BASE_PATH: /home/zenoh/my-first-flow/nodes
  DLL_EXTENSION: so
  
# (optional)
configuration:
  default_timeout: 10
  
# Only OPERATOR and SINK
inputs:
  - in    
  - tick
    
# Only OPERATOR and SOURCE
outputs: [out]
    
uri: "file://{{ BASE_PATH }}/target/release/libmy_operator.{{ DLL_EXTENSION }}"

(optional) Vars

This section is used to tell Zenoh-Flow how to do string replacements in this descriptor (and only this one). More details can be found here.

(optional) Configuration

This section allows passing a dictionary of key-value pairs to all the nodes involved. This can be useful, for instance, to run several times the same node but with slightly different parameters or to modify the behaviour of a node without having to recompile it.

An in-depth explanation can be found here.

Inputs and Outputs

Both specify the same information, for each Input or Output:

  • a unique (per category) identifier,

Identifiers must be unique per category. What this means is that Zenoh-Flow will refuse a descriptor where two inputs (resp. outputs) share the same, but will accept a descriptor where an input and an output share the same identifier.

URI

This specifies where to find, on the device where the daemon is running, the implementation of the node being described.

The scheme file:// must be added if the node implementation can be retrieved from a file, if the node is a builtin ones the builtin:// scheme must be used. For more information about builtin please refer to: Builtin Sources and Sinks