Initializes the service.
Creates and queues a thread job with the given data.
The data to create the thread job from.
The id of the created thread job in the database and queue.
This differs from the threadId, which is created by the os and set when the thread actually starts..
Requeues a thread job that was already completed.
The id of the job to requeue.
Optional
data: ThreadJobDataFunctionsAdditional data for the job.
Reruns a thread job that was already completed.
The id of the job to rerun.
Optional
data: ThreadJobDataFunctionsAdditional data for the job.
The thread job.
Runs the given function on a separate thread. This will not persist the state in the database.
IMPORTANT: This uses "eval" in the thread worker, so make sure that the data passed is not malicious.
The function that should be run in a separate thread.
The input value of the function.
Optional
timeout: numberA custom timeout for the task. Defaults to 5 minutes or an hour, depending on the priority.
Optional
priority: booleanWhether or not the function should make use of priority workers or not. Defaults to true.
The result value of the function passed.
Queues a thread job for the given data and waits for its completion.
The data of the job to queue.
The thread job.
Terminates all the workers.
Waits for the thread job with the given id to complete.
The id of the thread job to wait for.
The thread job.
Definition for a service that handles multithreading.