Background Jobs¶
Emakin performs most of its heavy operations on the background to achieve scalable and high performance outputs. These background operations are executed by Emakin’s service agent without any user interaction.
When a new process is initiated by a user, workflow state is recorded in the database without any further processing, and creates a couple of background jobs. Service agents retrieve the jobs from the queue and try to process on the background. If an error occurs while processing a job, transaction state is roll backed and error state is reported to the system administrators. When an administrator resolves an issue, job is re-queued in the system, from the job manager, to the process again. Some of the errors are automatically recovered by the system and queued again with time delay.
Service agents use multiple threads, and can also be deployed to any number of hardware instances to perform parallel execution. Jobs are executed in order of priority, and a single service agent can complete 600 jobs per minute for the basic workflow operations. This number is highly dependent on the job definition and hardware specifications.
State Transition¶
Every job is created in the "Waiting" state.
When a service agent pulls the job from the queue, agent locks the job and changes state to the "Processing".
If the job is successfully completed, the state changes to "Completed".
If the job generates an error, state changes to "Error", and system administrator is notified. Some of the job errors are automatically handled. For example, e-mail sending job errors are ignored and re-scheduled, and state changes to " Waiting" to try again later. If maximum try count limit is exceeded, the state is changed to the "Error" or "Aborted" by the configuration settings.
For "Aborted" and "Completed" states, job is automatically deleted from the system if the "Delete After" date passed.