Slither.Stage.Beam (Slither v0.1.0)

Copy Markdown View Source

Stage that runs an Elixir function.

Wraps a handler function as a pipeline stage. Supports both item-level and batch-level processing.

Options

  • :handler - Function (Slither.Item.t(), Slither.Context.t() -> term()) that processes a single item. The return value becomes the item's new payload. Can also return {:ok, payload}, {:skip, reason}, {:error, reason}, or {:route, dest, payload}.
  • :batch_handler - Optional function for batch processing.
  • :cardinality - :one (default) or :many. When :many, the handler returns a list and each element becomes a separate downstream item.