Tasks
enqueue(func_or_name, *args, job_queue='default', **kwargs)
¶
Enqueues a task in the task queue
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func_or_name
|
Callable | str
|
The function or its name to enqueue |
required |
*args
|
Any
|
Positional arguments to pass to the function |
()
|
job_queue
|
str
|
The name of the job queue to use (default: "default") |
'default'
|
**kwargs
|
Any
|
Keyword arguments to pass to the function |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Job |
Job
|
The queued Job's object |
enqueue_if_not_in_pipeline(func_or_name, *args, job_queue='default', **kwargs)
¶
Enqueues a task in the task queue if it's not already in the pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func_or_name
|
Callable | str
|
The function or its name to enqueue |
required |
*args
|
Any
|
Positional arguments to pass to the function |
()
|
job_queue
|
str
|
The name of the job queue to use (default: "default") |
'default'
|
**kwargs
|
Any
|
Keyword arguments to pass to the function |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Job |
Job
|
A tuple containing the Job's object and a boolean indicating whether the job was enqueued. |
Created |
bool
|
A boolean indicating whether the job was created. |