Create a durable executor.
The storage to use for the durable executor.
The options for the durable executor.
Optional
serializer?: SerializerThe serializer to use for the durable executor. If not provided, a default serializer using superjson will be used.
Optional
logger?: LoggerThe logger to use for the durable executor. If not provided, a console logger will be used.
Optional
enableDebug?: booleanWhether to enable debug logging. If true
, debug logging will
be enabled.
Optional
expireMs?: numberStart the durable executor. Starts a background process. Use DurableExecutor.shutdown to stop the durable executor.
Shutdown the durable executor. Cancels all active executions and stops the background process.
On shutdown, these happen in this order:
Add a task to the durable executor. See the task examples section for more details on creating tasks.
The task options. See DurableTaskOptions for more details on the task options.
The durable task.
Add a parent task to the durable executor. See the task examples section for more details on creating parent tasks.
The parent task options. See DurableParentTaskOptions for more details on the parent task options.
The durable parent task.
Create a new task that runs a sequence of tasks sequentially.
The tasks list must be a list of tasks that are compatible with each other. The input of any task must be the same as the output of the previous task. The output of the last task will be the output of the sequential task.
The tasks list cannot be empty.
The tasks to run sequentially.
The sequential task.
Enqueue a task for execution.
A handle to the task execution.
Get a handle to a task execution.
The task to get the handle for.
The id of the execution to get the handle for.
The handle to the task execution.
Get the running task execution ids.
The running task execution ids.
A durable executor. It is used to execute durable tasks.
Multiple durable executors can share the same storage. In such a case, all the tasks should be present for all the durable executors. The work is distributed among the durable executors. See the usage and task examples sections for more details on creating and enqueuing tasks.
Example