TemporalEx.DataConverter behaviour
(temporal_ex v0.2.1)
Copy Markdown
Behaviour for encoding/decoding Elixir terms to/from Temporal payloads.
The data converter is responsible for serializing workflow arguments, results, and other data that flows through Temporal. Implementations must handle arbitrary Elixir terms and produce binary data with encoding metadata.
The default implementation is TemporalEx.DataConverter.Json.
Summary
Callbacks
Decodes binary data back into an Elixir term.
Encodes an Elixir term into a binary with metadata.
Returns the encoding identifier (e.g., "json/plain").
Types
Callbacks
Decodes binary data back into an Elixir term.
The metadata map provides encoding hints (e.g., %{"encoding" => "json/plain"}).
Encodes an Elixir term into a binary with metadata.
Returns {:ok, {binary_data, metadata_map}} or {:error, reason}.
@callback encoding() :: encoding()
Returns the encoding identifier (e.g., "json/plain").