View Source Zenohex.PullSubscriber (Zenohex v0.3.0)

Documentation for Elixir.Zenohex.PullSubscriber.

Summary

Functions

Receive data. Normally users don't need to change the default timeout_us.

Types

Functions

@spec pull(t()) :: :ok | {:error, reason :: any()}

Pull data.

Examples

iex> {:ok, session} = Zenohex.open()
iex> {:ok, pull_subscriber} = Zenohex.Session.declare_pull_subscriber(session, "key/expression")
iex> Zenohex.PullSubscriber.pull(pull_subscriber)
:ok
Link to this function

recv_timeout(pull_subscriber, timeout_us \\ 1000)

View Source
@spec recv_timeout(t(), pos_integer()) ::
  {:ok, Zenohex.Sample.t()} | {:error, :timeout} | {:error, reason :: any()}

Receive data. Normally users don't need to change the default timeout_us.

Examples

iex> {:ok, session} = Zenohex.open()
iex> {:ok, pull_subscriber} = Zenohex.Session.declare_pull_subscriber(session, "key/expression")
iex> Zenohex.PullSubscriber.recv_timeout(pull_subscriber)
{:error, :timeout}