Lightstreamer.Subscription (Lightstreamer v0.1.0)

Copy Markdown View Source

Internal per-subscription state held by a Lightstreamer.Session.

The public handle for a subscription is the reference/0 returned by Lightstreamer.subscribe/2 (and carried in every delivery message); this struct never leaves the session process.

Summary

Types

t()

@type t() :: %Lightstreamer.Subscription{
  data_adapter: String.t() | nil,
  fields: [String.t()],
  id: pos_integer(),
  item_states: %{optional(pos_integer()) => [String.t() | nil]},
  items: tuple(),
  max_frequency: :unlimited | :unfiltered | float() | nil,
  mode: :merge,
  monitor: reference(),
  owner: pid(),
  ref: reference(),
  snapshot: boolean()
}
  • :ref — the public subscription handle
  • :id — the client-assigned LS_subId
  • :items — item names as a tuple, for 1-based index resolution
  • :data_adapter / :max_frequency — original request parameters, kept so the subscription can be re-issued verbatim after a session re-create (nil = not sent, server default applies)
  • :item_states — per-item merged field values, keyed by item index
  • :monitor — monitor on the owner pid, so its subscriptions die with it