A resource object, the unit of reconciliation.
A resource belongs to a controller (see Steward.Controller) and typically corresponds to
a domain entity, e.g. an order. Steward reconciles each resource's jobs separately, against
the spec its controller's workers compute for it.
Create resources with Steward.Controller.create_resource/3, and manage them with the
other functions in Steward.Controller.
Fields
:controller- the name of the resource's controller module.:id- the resource's UUID, unique per controller. Generated unless given on creation.:meta- a map of arbitrary domain information, e.g. foreign keys, seeSteward.Controller.list_resources_by_meta/2. Stored as JSON.:object- virtual field holding the domain data loaded bySteward.Controller.load/1. Not persisted.:cancelled_at- when the resource was cancelled, seeSteward.Controller.cancel_resource!/2.:pruned_at- when the jobs of the cancelled resource were deleted, see the:prune_max_ageoption ofSteward.Plugin.:reconciliation_state-:idle,:scheduled(due at:reconciliation_due_at) or:reconciling, set at:reconciliation_state_set_at.:reconciliation_error- the error of the last failed reconciliation, if any. Cleared when the resource is reconciled again.
Steward manages all fields but :meta and :object. Don't change them yourself.
Summary
Functions
Returns whether the resource is cancelled, see Steward.Controller.cancel_resource!/2.
Returns whether the jobs of the cancelled resource were pruned, see the :prune_max_age
option of Steward.Plugin.
Types
@type id() :: binary()
@type t() :: %Steward.Resource{ __meta__: term(), cancelled_at: term(), controller: term(), id: term(), inserted_at: term(), meta: term(), object: term(), pruned_at: term(), reconciliation_due_at: term(), reconciliation_error: term(), reconciliation_state: term(), reconciliation_state_set_at: term(), updated_at: term() }
Functions
Returns whether the resource is cancelled, see Steward.Controller.cancel_resource!/2.
Returns whether the jobs of the cancelled resource were pruned, see the :prune_max_age
option of Steward.Plugin.