View Source Jido.Signal (Jido v1.0.0-rc.5)
Defines the structure and behavior of a Signal in the Jido system. This is a local implementation of the CloudEvents specification v1.0.
Summary
Types
Functions
Creates a new Signal struct from a map.
Parameters
map
: A map containing the Signal attributes.
Returns
{:ok, Signal.t()}
if the map is valid, {:error, String.t()}
otherwise.
Examples
iex> Jido.Signal.from_map(%{"type" => "example.event", "source" => "/example", "id" => "123"})
{:ok, %Jido.Signal{type: "example.event", source: "/example", id: "123", ...}}
Creates a new Signal struct.
Parameters
attrs
: A map containing the Signal attributes.
Returns
{:ok, Signal.t()}
if the attributes are valid, {:error, String.t()}
otherwise.
Examples
iex> Jido.Signal.new(%{type: "example.event", source: "/example", id: "123"})
{:ok, %Jido.Signal{type: "example.event", source: "/example", id: "123", ...}}