Zenohex.Publisher (Zenohex v0.7.1)

View Source

Interface for publishing data via native Zenoh publishers.

This module provides functions to send data using a previously declared publisher and to undeclare it when no longer needed.

Publisher IDs are obtained from Zenohex.Session.declare_publisher/3.

Summary

Functions

Sends a kind: :delete sample using the specified publisher.

Sends a kind: :put sample with binary payload using the specified publisher.

Undeclares the publisher identified by the given ID.

Types

delete_opts()

@type delete_opts() :: [
  attachment: binary() | nil,
  timestamp: Zenohex.Session.zenoh_timestamp_string()
]

id()

@type id() :: reference()

put_opts()

@type put_opts() :: [
  attachment: binary() | nil,
  encoding: String.t(),
  timestamp: Zenohex.Session.zenoh_timestamp_string()
]

Functions

delete(id, opts \\ [])

@spec delete(id(), delete_opts()) :: :ok | {:error, reason :: term()}

Sends a kind: :delete sample using the specified publisher.

put(id, payload, opts \\ [])

@spec put(id(), binary(), put_opts()) :: :ok | {:error, reason :: term()}

Sends a kind: :put sample with binary payload using the specified publisher.

undeclare(id)

@spec undeclare(id()) :: :ok | {:error, reason :: term()}

Undeclares the publisher identified by the given ID.