dawdle v0.5.1 Dawdle.MessageEncoder behaviour View Source

Behaviour for Dawdle event encoding.

Dawdle wants to enqueue Elixir structs and other Erlang terms. This behaviour specifies an interface for translating an event, i.e., term, into a string that can be safely enqueued.

Link to this section Summary

Callbacks

Decode a string pulled from the queue into its original representation.

Encode an event into a string that is safe to enqueue.

Link to this section Callbacks

Link to this callback

decode(message) View Source
decode(message :: String.t()) :: any()

Decode a string pulled from the queue into its original representation.

Link to this callback

encode(event) View Source
encode(event :: any()) :: String.t()

Encode an event into a string that is safe to enqueue.