Job Async Executor: Running Long Running or Multi-step Async Tasks
- Long Running Jobs: These are jobs that take several minutes or hours to execute.
- Multi-step Async Tasks: This is a task consisting of multiple steps.
An example is as follows:
- Trancoding a file
- Creating an asset from a file
- Adding technical metadata to the asset
There are two scenarios in which a developer could implement long running and multi-step async tasks in JEF:
A developer could develop an action executor that configures async behaviour by listening to an external event (example: register to message queue, or prepare to receive a REST request) to continue progress and finally complete / fail / cancel the job.
A developer could develop an action executor that configures async behaviour via an active component, that needs to be run periodically in order to retrieve the current status and finally complete / fail / cancel the job.
Example: Periodically polling a third party service in order to retrieve the status of a job.
JEF currently supports the infrastructure for both these scenarios. However, in scenario 2 we have provided an ActionProgress mechanism which can help with implementation.