Extreme behaviour (extreme v1.1.1)

View Source

TODO

Summary

Types

t()

@type t() :: module()

Callbacks

connect_to_persistent_subscription(subscriber, stream, group, allowed_in_flight_messages)

@callback connect_to_persistent_subscription(
  subscriber :: pid(),
  stream :: String.t(),
  group :: String.t(),
  allowed_in_flight_messages :: integer()
) :: {:ok, pid()}

Spawns a persistent subscription.

The persistent subscription will send events to the subscriber process in the form of GenServer.cast/2s in the shape of {:on_event, event, correlation_id}.

See Extreme.PersistentSubscription for full details.

execute(message, correlation_id, timeout)

@callback execute(message :: term(), correlation_id :: binary(), timeout :: integer()) ::
  term()

TODO

ping()

@callback ping() :: :pong

Pings connected EventStore and should return :pong back.

read_and_stay_subscribed( stream, subscriber, from_event_number, per_page, resolve_link_tos, require_master )

@callback read_and_stay_subscribed(
  stream :: String.t(),
  subscriber :: pid(),
  from_event_number :: integer(),
  per_page :: integer(),
  resolve_link_tos :: boolean(),
  require_master :: boolean()
) :: {:ok, pid()}

TODO

start_link(config, opts)

@callback start_link(config :: Keyword.t(), opts :: Keyword.t()) ::
  {:ok, pid()} | {:error, {:already_started, pid()}} | {:error, term()}

TODO

subscribe_to(stream, subscriber, opts)

@callback subscribe_to(stream :: String.t(), subscriber :: pid(), opts :: Keyword.t()) ::
  {:ok, pid()}

TODO

unsubscribe(subscription)

@callback unsubscribe(subscription :: pid()) :: :ok

TODO