View Source RabbitMQStream.Consumer.FlowControl behaviour (rabbitmq_stream v0.4.1)
Behavior for flow control strategies.
Existing Strategies
You can use the default strategies by passing a shorthand alias:
Summary
Callbacks
Initializes the strategy state.
Callback responsible for deciding whether to add more credit, based on its internal state.
Types
@type t() :: module()
Callbacks
Initializes the strategy state.
Parameters
opts
- a keyword list of the options passed to the consumer, merged with the options passed to the strategy itself.
@callback run(state :: term(), subscription :: RabbitMQStream.Consumer.t()) :: {:credit, amount :: non_neg_integer(), state :: term()} | {:skip, state :: term()}
Callback responsible for deciding whether to add more credit, based on its internal state.
Parameters
state
- the state of the strategysubscription
- the state of the owner subscription process