Example GenServer implementation of Queryable
using Zenohex.Session.declare_queryable/4.
This example demonstrates how to receive queries.
For the actual implementation, please refer to the following,
Examples
iex> Zenohex.Examples.Queryable.start_link([])
Summary
Functions
@spec start_link( session_id: Zenohex.Session.id(), key_expr: String.t(), name: GenServer.name(), callback: (Zenohex.Query.t() -> term()) ) :: GenServer.on_start()
Starts Elixir.Zenohex.Examples.Queryable.
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 query is received- To reply to the query, use a callback that calls
Zenohex.Query.reply/3.
- To reply to the query, use a callback that calls
@spec stop(GenServer.server()) :: :ok | {:error, reason :: term()}
Stops Elixir.Zenohex.Examples.Queryable