Rig.BrokerConnection behaviour (Reactive Interaction Gateway v3.0.0-alpha.2) View Source

Interface to any publish-subscribe capable broker service.

Link to this section Summary

Link to this section Types

Specs

callback() :: (RigCloudEvents.CloudEvent.t() -> :ok | {:error, any()})

Specs

connection() :: any()

Specs

subscription_id() :: any()

Specs

topic() :: String.t()

Link to this section Callbacks

Link to this callback

publish(connection, topic, key, arg4)

View Source

Specs

publish(connection(), topic(), key :: String.t(), RigCloudEvents.CloudEvent.t()) ::
  :ok
Link to this callback

subscribe(connection, topic, callback)

View Source

Specs

subscribe(connection(), topic(), callback()) ::
  {:ok, subscription_id()} | {:error, any()}
Link to this callback

unsubscribe(subscription_id)

View Source

Specs

unsubscribe(subscription_id()) :: :ok