LemonCore. Events. RunCompleted
(lemon_core v0.1.0)
View Source
A run reached a terminal state, successfully or not. Published on run:<run_id>.
The most widely consumed payload in the umbrella — twelve subscribers across six apps.
meta.synthetic marks completions the router fabricated because the engine never
reported one (watchdog timeout, abort, gateway process death).
Summary
Functions
The LemonCore.Event type atom this payload is published under.
Payload version. Bumped only for a breaking field change (see the semver table in docs/platform/bus-events.md §4.3).
The struct's field names, in declaration order.
Build from a legacy map, coercing the nested completion too.
Build the payload, raising on unknown or missing keys.
Types
@type t() :: %LemonCore.Events.RunCompleted{ completed: LemonCore.Events.Completion.t(), duration_ms: non_neg_integer() | nil }
Functions
@spec event_type() :: atom()
The LemonCore.Event type atom this payload is published under.
@spec event_version() :: pos_integer()
Payload version. Bumped only for a breaking field change (see the semver table in docs/platform/bus-events.md §4.3).
@spec fields() :: [atom()]
The struct's field names, in declaration order.
@spec from_map(map() | struct() | keyword()) :: struct()
@spec from_map(map() | struct() | keyword()) :: t()
Build from a legacy map, coercing the nested completion too.
Build the payload, raising on unknown or missing keys.
This is the publisher-side constructor: a typo should fail at the point of publish, not silently produce a payload with a nil field that a consumer reads as absent.