Zenohex.Examples.Scout (Zenohex v0.9.1-beta.1)

Copy Markdown View Source

Example GenServer implementation of Scout using Zenohex.Scouting.declare_scout/3.

This example demonstrates how to scout.

For the actual implementation, please refer to the following,

Examples

iex> Zenohex.Examples.Scout.start_link([])

Summary

Functions

start_link(args)

@spec start_link(
  what: Zenohex.Scouting.what(),
  config: Zenohex.Config.t(),
  name: GenServer.name(),
  callback: (Zenohex.Scouting.Hello.t() -> term())
) :: GenServer.on_start()

Starts Elixir.Zenohex.Examples.Scout.

Parameters

  • args – a keyword list that can include the following keys:
    • :what – the target to scout (e.g., :peer or :router)
    • :config – the configuration used for scouting
    • :callback – a function to be called when a hello message is received

stop(name \\ __MODULE__)

@spec stop(GenServer.server()) :: :ok | {:error, reason :: term()}

Stops Elixir.Zenohex.Examples.Scout