Kelvin.InOrderSubscription (Kelvin v0.4.0) View Source

A subscription producer which processes events in order as they appear in the EventStoreDB

Options

  • :name - (optional) the GenServer name for this producer
  • :stream_name - (required) the stream name to which to subscribe
  • :connection - (required) the Extreme client module to use as a connection to the EventStoreDB. This may either be the name of the Extreme client module or its pid.
  • :restore_stream_position! - (required) a function which determines the stream position from which this listener should begin after initializing or restarting. Values may be either an MFA tuple or a 0-arity anonymous function.
  • :subscribe_on_init? - (required) a function which determines whether the producer should subscribe immediately after starting up. Values may be either an MFA tuple or a 0-arity anonymous function. The function should return either true to subscribe immediately on initialization or false if the author intends on manually subscribing the producer. This producer can be manually subscribed by send/2ing a message of :subscribe to the process.
  • :subscribe_after - (default: Enum.random(3_000..5_000)) the amount of time to wait after initializing to query the :subscribe_on_init? option. This can be useful to prevent all producers from trying to subscribe at the same time and to await an active connection to the EventStoreDB.
  • :catch_up_chunk_size - (default: 256) the number of events to query for each read chunk while catching up. This option presents a trade-off between network queries and query duration over the network.

Link to this section Summary

Link to this section Functions