View Source Spear.PersistentSubscription.Settings (Spear v1.4.0)

A struct representing possible settings for a persistent subscription

Link to this section Summary

Types

Possible values for consumer strategies

t()

Settings for a persistent subscription

Link to this section Types

Link to this type

consumer_strategy()

View Source (since 0.6.0)
@type consumer_strategy() :: :RoundRobin | :Pinned | :DispatchToSingle

Possible values for consumer strategies

The consumer strategy controls how messages are distributed to multiple subscribers. The setting has no effect for single-subscriber persistent subscriptions.

@type t() :: %Spear.PersistentSubscription.Settings{
  checkpoint_after: {:ticks, pos_integer()} | pos_integer(),
  extra_statistics?: boolean() | nil,
  history_buffer_size: pos_integer(),
  live_buffer_size: pos_integer(),
  max_checkpoint_count: pos_integer(),
  max_retry_count: non_neg_integer(),
  max_subscriber_count: pos_integer(),
  message_timeout: {:ticks, pos_integer()} | pos_integer(),
  min_checkpoint_count: pos_integer(),
  named_consumer_strategy: consumer_strategy(),
  read_batch_size: pos_integer(),
  resolve_links?: boolean(),
  revision: non_neg_integer()
}

Settings for a persistent subscription

See the EventStoreDB documentation for more information on each setting.

The defaults for this struct are set up for a simple case of a single subscriber process.

:message_timeout and :checkpoint_after may either be specified as {:ticks, ticks} or any integer where the ticks denote the EventStoreDB tick timing. Integers are read as durations in milliseconds.