Example GenServer implementation of Subscriber
using Zenohex.Session.declare_subscriber/4.
This example demonstrates how to receive samples.
For the actual implementation, please refer to the following,
Examples
iex> Zenohex.Examples.Subscriber.start_link([])
Summary
Functions
@spec start_link( session_id: Zenohex.Session.id(), key_expr: String.t(), name: GenServer.name(), callback: (Zenohex.Sample.t() -> term()) ) :: GenServer.on_start()
Starts Elixir.Zenohex.Examples.Subscriber.
Parameters
args– a keyword list that can include the following keys::session_id– the ID of the session:key_expr– the key expression to subscribe to:callback– the function to call when a sample is received
@spec stop(GenServer.server()) :: :ok | {:error, reason :: term()}
Stops Elixir.Zenohex.Examples.Subscriber