View Source Zenohex.Session (Zenohex v0.3.0)
Documentation for Elixir.Zenohex.Session
.
Summary
Functions
Create a Publisher for the given key expression.
Create a PullSubscriber for the given key expression.
Create a Quaryable for the given key expression.
Create a Subscriber for the given key expression.
Delete data.
Get reply receiver from the matching queryables in the system.
Query data from receiver. Normally users don't need to change the default timeout_us.
Get one data from the matching queryables in the system.
To get multiple data, use get_reply_receiver/2
and get_reply_timeout/1
instead.
Put data.
Types
Functions
declare_publisher(session, key_expr, opts \\ %Publisher.Options{})
View Source@spec declare_publisher(t(), String.t(), Zenohex.Publisher.Options.t()) :: {:ok, Zenohex.Publisher.t()} | {:error, reason :: any()}
Create a Publisher for the given key expression.
Examples
iex> {:ok, session} = Zenohex.open()
iex> Zenohex.Session.declare_publisher(session, "key/expression")
declare_pull_subscriber(session, key_expr, opts \\ %Subscriber.Options{})
View Source@spec declare_pull_subscriber(t(), String.t(), Zenohex.Subscriber.Options.t()) :: {:ok, Zenohex.PullSubscriber.t()} | {:error, reason :: any()}
Create a PullSubscriber for the given key expression.
Examples
iex> {:ok, session} = Zenohex.open()
iex> Zenohex.Session.declare_pull_subscriber(session, "key/expression")
declare_queryable(session, key_expr, opts \\ %Queryable.Options{})
View Source@spec declare_queryable(t(), String.t(), Zenohex.Queryable.Options.t()) :: {:ok, Zenohex.Queryable.t()} | {:error, reason :: any()}
Create a Quaryable for the given key expression.
Examples
iex> {:ok, session} = Zenohex.open()
iex> Zenohex.Session.declare_queryable(session, "key/expression")
declare_subscriber(session, key_expr, opts \\ %Subscriber.Options{})
View Source@spec declare_subscriber(t(), String.t(), Zenohex.Subscriber.Options.t()) :: {:ok, Zenohex.Subscriber.t()} | {:error, reason :: any()}
Create a Subscriber for the given key expression.
Examples
iex> {:ok, session} = Zenohex.open()
iex> Zenohex.Session.declare_subscriber(session, "key/expression")
Delete data.
Examples
iex> {:ok, session} = Zenohex.open()
iex> Zenohex.Session.delete(session, "key/expression")
:ok
@spec get_reply_receiver(t(), String.t(), Zenohex.Query.Options.t()) :: {:ok, receiver()} | {:error, reason :: any()}
Get reply receiver from the matching queryables in the system.
Examples
iex> {:ok, session} = Zenohex.open()
iex> Zenohex.Session.get_reply_receiver(session, "key/**")
@spec get_reply_timeout(receiver(), pos_integer()) :: {:ok, Zenohex.Sample.t()} | {:error, :timeout} | {:error, :disconnected} | {:error, reason :: any()}
Query data from receiver. Normally users don't need to change the default timeout_us.
Examples
iex> {:ok, session} = Zenohex.open()
iex> {:ok, receiver} = Zenohex.Session.get_reply_receiver(session, "key/**")
iex> Zenohex.Session.get_reply_timeout(receiver)
{:error, :disconnected}
get_timeout(session, selector, timeout_us, opts \\ %Query.Options{})
View Source@spec get_timeout(t(), String.t(), pos_integer(), Zenohex.Query.Options.t()) :: {:ok, Zenohex.Sample.t()} | {:error, :timeout} | {:error, :disconnected} | {:error, reason :: any()}
Get one data from the matching queryables in the system.
To get multiple data, use get_reply_receiver/2
and get_reply_timeout/1
instead.
Examples
iex> {:ok, session} = Zenohex.open()
iex> Zenohex.Session.get_timeout(session, "key/expression", 1000)
{:error, :disconnected}
Put data.
Examples
iex> {:ok, session} = Zenohex.open()
iex> :ok = Zenohex.Session.put(session, "key/expression", "value")
iex> :ok = Zenohex.Session.put(session, "key/expression", 0)
iex> :ok = Zenohex.Session.put(session, "key/expression", 0.0)