Events service: pull-point subscriptions.
{:ok, sub} = ExOxvif.Events.create_pull_point(session, termination: 60_000)
{:ok, messages} = ExOxvif.Events.pull_messages(session, sub, wait: 5_000)Durations are given in milliseconds and sent to the device as ISO 8601
durations. A subscription expires unless renewed with renew/3.
Summary
Functions
Create a pull-point subscription.
Pull pending messages, waiting on the device for up to :wait
milliseconds (default 5000) for at least one.
Extend a subscription to termination milliseconds from now. Returns the
new termination time reported by the device.
Cancel a subscription.
Functions
@spec create_pull_point(ExOxvif.Session.t(), keyword()) :: {:ok, ExOxvif.Events.Subscription.t()} | {:error, ExOxvif.Error.t()}
Create a pull-point subscription.
Options:
:filter- a topic expression, e.g."tns1:VideoSource/MotionAlarm":termination- initial lifetime in milliseconds (device default if omitted)
@spec pull_messages( ExOxvif.Session.t(), ExOxvif.Events.Subscription.t() | String.t(), keyword() ) :: {:ok, [ExOxvif.Events.Message.t()]} | {:error, ExOxvif.Error.t()}
Pull pending messages, waiting on the device for up to :wait
milliseconds (default 5000) for at least one.
Options: :wait, :max_messages (default 100). The call :timeout
defaults to :wait plus 15 seconds.
@spec renew( ExOxvif.Session.t(), ExOxvif.Events.Subscription.t() | String.t(), pos_integer(), ExOxvif.call_opts() ) :: {:ok, String.t()} | {:error, ExOxvif.Error.t()}
Extend a subscription to termination milliseconds from now. Returns the
new termination time reported by the device.
@spec unsubscribe( ExOxvif.Session.t(), ExOxvif.Events.Subscription.t() | String.t(), ExOxvif.call_opts() ) :: :ok | {:error, ExOxvif.Error.t()}
Cancel a subscription.