MCPcopy Create free account
hub / github.com/celery/celery / apply_async

Method apply_async

celery/app/task.py:587–761  ·  view source on GitHub ↗

Apply tasks asynchronously by sending a message. Arguments: args (Tuple): The positional arguments to pass on to the task. kwargs (Dict): The keyword arguments to pass on to the task. countdown (float): Number of seconds into the future that the

(self, args=None, kwargs=None, task_id=None, producer=None,
                    link=None, link_error=None, shadow=None, **options)

Source from the content-addressed store, hash-verified

585 return self.apply_async(args, kwargs)
586
587 def apply_async(self, args=None, kwargs=None, task_id=None, producer=None,
588 link=None, link_error=None, shadow=None, **options):
589 """Apply tasks asynchronously by sending a message.
590
591 Arguments:
592 args (Tuple): The positional arguments to pass on to the task.
593
594 kwargs (Dict): The keyword arguments to pass on to the task.
595
596 countdown (float): Number of seconds into the future that the
597 task should execute. Defaults to immediate execution.
598
599 eta (~datetime.datetime): Absolute time and date of when the task
600 should be executed. May not be specified if `countdown`
601 is also supplied.
602
603 expires (float, ~datetime.datetime): Datetime or
604 seconds in the future for the task should expire.
605 The task won't be executed after the expiration time.
606
607 shadow (str): Override task name used in logs/monitoring.
608 Default is retrieved from :meth:`shadow_name`.
609
610 connection (kombu.Connection): Reuse existing broker connection
611 instead of acquiring one from the connection pool.
612
613 retry (bool): If enabled sending of the task message will be
614 retried in the event of connection loss or failure.
615 Default is taken from the :setting:`task_publish_retry`
616 setting. Note that you need to handle the
617 producer/connection manually for this to work.
618
619 retry_policy (Mapping): Override the retry policy used.
620 See the :setting:`task_publish_retry_policy` setting.
621
622 time_limit (int): If set, overrides the default time limit.
623
624 soft_time_limit (int): If set, overrides the default soft
625 time limit.
626
627 queue (str, kombu.Queue): The queue to route the task to.
628 This must be a key present in :setting:`task_queues`, or
629 :setting:`task_create_missing_queues` must be
630 enabled. See :ref:`guide-routing` for more
631 information.
632
633 exchange (str, kombu.Exchange): Named custom exchange to send the
634 task to. Usually not used in combination with the ``queue``
635 argument.
636
637 routing_key (str): Custom routing key used to route the task to a
638 worker server. If in combination with a ``queue`` argument
639 only used to specify custom routing keys to topic exchanges.
640
641 priority (int): The task priority, a number between 0 and 9.
642 The interpretation is broker-specific: with RabbitMQ, higher
643 numbers denote higher priority; with Redis, priority ``0`` is
644 the highest priority. See

Callers 8

delayMethod · 0.95
execute_using_poolMethod · 0.45
_retry_worker_lostMethod · 0.45
call_taskMethod · 0.45
_call_task_errbacksMethod · 0.45
fallback_chord_unlockMethod · 0.45
retryMethod · 0.45
groupFunction · 0.45

Calls 9

shadow_nameMethod · 0.95
_get_exec_optionsMethod · 0.95
_get_appMethod · 0.95
applyMethod · 0.95
denied_join_resultFunction · 0.90
producer_or_acquireMethod · 0.80
getMethod · 0.45
setdefaultMethod · 0.45
send_taskMethod · 0.45

Tested by

no test coverage detected