Provides functions for Zenoh scouting, which allows discovery of peers and routers.
This module wraps Zenoh's scouting functionality, enabling Elixir programs to send scout messages,
receive Hello replies, and manage periodic scouting processes.
See the Zenohex.Scouting.Hello module for details on the reply format.
Summary
Functions
Declares a scout that periodically sends scout messages and waits for Hello replies.
Sends scout messages and waits for Hello replies.
Stop scouting.
Types
@type scout() :: reference()
@type what() :: :peer | :router
Functions
@spec declare_scout(what(), Zenohex.Config.t(), pid()) :: {:ok, scout()} | {:error, reason :: term()}
Declares a scout that periodically sends scout messages and waits for Hello replies.
Parameters
what::peeror:router.config: The configuration to use for scoutingpid: Process to receive Hello messages. Defaults to the calling process.- Messages are delivered as
Zenohex.Scouting.Hello.
- Messages are delivered as
@spec scout(what(), Zenohex.Config.t(), non_neg_integer()) :: {:ok, [Zenohex.Scouting.Hello.t()]} | {:error, :timeout} | {:error, reason :: term()}
Sends scout messages and waits for Hello replies.
Parameters
what::peeror:router.config: The configuration to use for scoutingtimeout: Timeout in milliseconds to wait for Hello replies.
Stop scouting.