Orchid.Param (Orchid v0.5.6)

Copy Markdown View Source

The standard unit of data exchange.

Every step receives and returns Param structs (or lists/tuples of them). It carries the payload and metadata.

The purpose of this module is to abstract parameter handling and define a consistent interface for data exchange. This standardization allows developers using Orchid to focus on their business logic rather than the details of data flow management.

Summary

Types

name()

@type name() :: term()

param_type()

@type param_type() :: atom() | module()

payload()

@type payload() :: raw_payload() | ref_payload()

raw_payload()

@type raw_payload() :: any() | nil

ref_payload()

@type ref_payload() :: {:ref, module() | pid(), term()}

t()

@type t() :: %Orchid.Param{
  metadata: map(),
  name: name(),
  payload: payload(),
  type: param_type()
}

Functions

get_payload(param)

@spec get_payload(t()) :: payload()

new(name, type, payload \\ nil, metadata \\ %{})

@spec new(name(), param_type(), payload(), %{}) :: t()

set_payload(param, new_payload)

@spec set_payload(t(), payload()) :: t()