Broker-specific carriers for the pathway header.
A carrier is the part of an inbound or outbound message that holds the
pathway header: a flat attribute map or header list for Pub/Sub, Kafka and
RabbitMQ, or the _datadog JSON message attribute for SQS. Flat and
Sqs implement the behaviour; adapter/1 selects one from the carrier's
shape, so DdDataStreams.Checkpoints stays free of broker conditionals.
Summary
Functions
Selects the adapter that understands carrier's shape.
Reads the pathway out of carrier under key, like get/2, but tells a
header that is absent from one that is present and cannot be read.
Reads the pathway out of carrier under key, using the adapter selected by
its shape.
Writes pathway into carrier under key, using the adapter selected by
its shape.
Measures the size in bytes of the carrier entries.
Callbacks
@callback fetch(carrier :: term(), key :: String.t()) :: {:ok, DdDataStreams.Pathway.t()} | :absent | {:error, :malformed}
@callback get(carrier :: term(), key :: String.t()) :: DdDataStreams.Pathway.t() | nil
@callback put(carrier :: term(), pathway :: DdDataStreams.Pathway.t(), key :: String.t()) :: term()
@callback size(carrier :: term()) :: non_neg_integer()
Functions
Selects the adapter that understands carrier's shape.
@spec fetch(term(), String.t()) :: {:ok, DdDataStreams.Pathway.t()} | :absent | {:error, :malformed}
Reads the pathway out of carrier under key, like get/2, but tells a
header that is absent from one that is present and cannot be read.
@spec get(term(), String.t()) :: DdDataStreams.Pathway.t() | nil
Reads the pathway out of carrier under key, using the adapter selected by
its shape.
@spec put(term(), DdDataStreams.Pathway.t()) :: term()
@spec put(term(), DdDataStreams.Pathway.t(), String.t()) :: term()
Writes pathway into carrier under key, using the adapter selected by
its shape.
@spec size(term()) :: non_neg_integer()
Measures the size in bytes of the carrier entries.