Task Engine Architecture - dm03514/func-y-task-engine GitHub Wiki
Task Engine
Task Machine
Task Events
Task Event
Fulfillment Strategies
Fulfillment strategies are the entry point of an event and are handled control as soon as the event is executed.
They are passed an initiator
and conditions
as well as any other custom **kwargs
.
There are two types of fulfillment strategies:
- Single-Application Conditions (one-off)
- Multi-Application Conditions (polling/async/reactive)
These refer to the strategies application of conditions. In single-application conditions the strategy calls conditions.apply()
a single time, the result of which determines task failure or a state transition.
In multi-application the fulfillment strategy can call conditions.apply()
multiple times, handling the case where a condition is not yet applied. In multi-application the only way for an event state to end is either a timeout (global or event-specific) or the conditions are applied successfully.
Initiator
Specifies an action to execute after transitioning to an event.
Transition Conditions
initialize()
withValuesable
apply()
wraps the original result with each conditions application, or raisesConditionNotMet
- Access applied conditions through
conditions.values()