Execution Engine MkII
The EE is split into 2 main parts
- Executor - This is responsible for driving the workflows to completion and should contain all the objects required for each workflow to be executed, think of this as a runtime.
- Reactor - The reactor is responsible for notifying the executor when a future can make progress, this is done via the Waker API.
When a workflow is sent to the EE, the flow is as follows:
- Spawn a new task which will perform all of the work associated with executing a wf to completion
- Deserialize the workflow into a Job, the Job type should describe the entity as accurately as possible
- Drive the workflow forward, this uses an event based stream to do so
When a workflow reaches a point where it cannot make progress (e.g. waiting for Bots to Lock or waiting for an Activity to complete) it should yield execution using the underlying mechanics of Rust’s async/await.
The logic for executing a job
The interface for running a node
Register interest in events and wake futures when the event occurs
Spawns new jobs and handles cancellations
The workflow module contains the structs and functions relating to the Workflow object and job object.
Sets up the runtime and starts the message broker listeners