A process is an asynchronously running component that is typically defined as a static, “long-running” part of the workflow.
Different processes are able to run asynchronously with each other in an asyncio event loop, so when a process is doing IO jobs, it will not be blocking other process from running to the terminal state.
WorkChain is a subclass of
Process, with additional features for running a process as a set of discrete steps (also known as instructions).
WorkChain is created with a series of instructions to be carried out, and has the ability to save the state of the process after each instruction has completed.
The set of instructions is defined in the
outline method, which provides a succinct summary of the logical steps that the workchain will perform.
WorkChains support the use of logical constructs such as
While_ to control the state flow of certain processes.
Controller can control processes throughout their lifetime, by sending and receiving messages. It can launch, pause, continue, kill and check status of the process.
The thread communicator runs on a independent thread (event loop) and so will not be blocked by sometimes long waiting times in the process event loop. Using RabbitMQ means that even if the computer is terminated unexpectedly, messages are persisted and can be run once the computer restarts.