Skip to main content

call

Call a task by name.

def call(
ctx: click.Context,
name: string,
args: list = [],
kwargs: dict = {},
eta: string,
countdown: float,
expires: string|float,
serializer: string = json,
queue: string,
exchange: string,
routing_key: string
) - > null

Call a task by name.

Parameters

NameTypeDescription
ctxclick.ContextThe Click context object containing the Celery application instance and configuration.
namestringThe fully qualified name of the Celery task to be executed.
argslist = []A list of positional arguments to pass to the task function.
kwargsdict = {}A dictionary of keyword arguments to pass to the task function.
etastringThe scheduled time in ISO8601 format when the task should be executed.
countdownfloatThe number of seconds from the current time to wait before executing the task.
expires`stringfloat`
serializerstring = jsonThe name of the serialization method used to encode the task message.
queuestringThe name of the specific message queue to which the task should be routed.
exchangestringThe name of the custom exchange to use for routing the task message.
routing_keystringThe custom routing key used to determine which queue receives the task message.

Returns

TypeDescription
nullThe function prints the unique task ID to the standard output and returns nothing.