Pulsar.Reader.Callback (Pulsar v3.0.1)

Copy Markdown View Source

Internal callback module for Pulsar.Reader.

Implements the Pulsar.Consumer.Callback behaviour, forwarding messages to the reader's stream process, and hosts the flow policy that reports what each delivery cost.

Summary

Functions

became_active(state)

Callback implementation for Pulsar.Consumer.Callback.became_active/1.

became_passive(state)

Callback implementation for Pulsar.Consumer.Callback.became_passive/1.

handle_call(request, from, state)

Callback implementation for Pulsar.Consumer.Callback.handle_call/3.

handle_cast(request, state)

Callback implementation for Pulsar.Consumer.Callback.handle_cast/2.

handle_info(message, state)

Callback implementation for Pulsar.Consumer.Callback.handle_info/2.

handle_invalid_message(message, state)

Callback implementation for Pulsar.Consumer.Callback.handle_invalid_message/2.

report_permits(map, stream_pid, reader_ref)

@spec report_permits(map(), pid(), reference()) :: :ok

Flow policy for a reader's consumer, configured as {Pulsar.Reader.Callback, :report_permits, [stream_pid, reader_ref]}.

Reports rather than grants: the stream process refills as it consumes, which is what keeps the broker from sending further ahead than the stream has read.

terminate(reason, state)

Callback implementation for Pulsar.Consumer.Callback.terminate/2.