Spear.list_persistent_subscriptions

You're seeing just the function list_persistent_subscriptions, go back to Spear module for more information.
Link to this function

list_persistent_subscriptions(conn, opts \\ [])

View Source (since 0.6.0)

Specs

list_persistent_subscriptions(
  connection :: Spear.Connection.t(),
  opts :: Keyword.t()
) :: {:ok, Enumerable.t()} | {:error, any()}

Lists the currently existing persistent subscriptions

Results are returned in an Enumerable.t/0 of Spear.PersistentSubscription.t/0.

Note that the :extra_statistics? field of settings is not determined by this function: :extra_statistics? will always be returned as nil in this function.

This function works by reading the built-in $persistentSubscriptionConfig stream. This stream can be read normally to obtain additional information such as at timestamp for the last time the persistent subscription config was updated.

Options

Options are passed to read_stream/3. :direction, :from, and :max_count are fixed and cannot be overridden.

Examples

iex> Spear.create_persistent_subscription(conn, "my_stream", "my_group", %Spear.PersistentSubscription.Settings{})
:ok
iex> {:ok, subscriptions} = Spear.list_persistent_subscriptions(conn)
iex> subscriptions |> Enum.to_list()
[
  %Spear.PersistentSubscription{
    group_name: "my_group",
    settings: %Spear.PersistentSubscription.Settings{
      checkpoint_after: 3000,
      extra_statistics?: nil,
      history_buffer_size: 300,
      live_buffer_size: 100,
      max_checkpoint_count: 100,
      max_retry_count: 10,
      max_subscriber_count: 1,
      message_timeout: 5000,
      min_checkpoint_count: 1,
      named_consumer_strategy: :RoundRobin,
      read_batch_size: 100,
      resolve_links?: true,
      revision: 0
    },
    stream_name: "my_stream"
  }
]