MCPcopy
hub / github.com/celery/celery / join

Method join

celery/result.py:714–786  ·  view source on GitHub ↗

Gather the results of all tasks as a list in order. Note: This can be an expensive operation for result store backends that must resort to polling (e.g., database). You should consider using :meth:`join_native` if your backend supports it.

(self, timeout=None, propagate=True, interval=0.5,
             callback=None, no_ack=True, on_message=None,
             disable_sync_subtasks=True, on_interval=None)

Source from the content-addressed store, hash-verified

712 )
713
714 def join(self, timeout=None, propagate=True, interval=0.5,
715 callback=None, no_ack=True, on_message=None,
716 disable_sync_subtasks=True, on_interval=None):
717 """Gather the results of all tasks as a list in order.
718
719 Note:
720 This can be an expensive operation for result store
721 backends that must resort to polling (e.g., database).
722
723 You should consider using :meth:`join_native` if your backend
724 supports it.
725
726 Warning:
727 Waiting for tasks within a task may lead to deadlocks.
728 Please see :ref:`task-synchronous-subtasks`.
729
730 Arguments:
731 timeout (float): The number of seconds to wait for results
732 before the operation times out.
733 propagate (bool): If any of the tasks raises an exception,
734 the exception will be re-raised when this flag is set.
735 interval (float): Time to wait (in seconds) before retrying to
736 retrieve a result from the set. Note that this does not have
737 any effect when using the amqp result store backend,
738 as it does not use polling.
739 callback (Callable): Optional callback to be called for every
740 result received. Must have signature ``(task_id, value)``
741 No results will be returned by this function if a callback
742 is specified. The order of results is also arbitrary when a
743 callback is used. To get access to the result object for
744 a particular id you'll have to generate an index first:
745 ``index = {r.id: r for r in gres.results.values()}``
746 Or you can create new result objects on the fly:
747 ``result = app.AsyncResult(task_id)`` (both will
748 take advantage of the backend cache anyway).
749 no_ack (bool): Automatic message acknowledgment (Note that if this
750 is set to :const:`False` then the messages
751 *will not be acknowledged*).
752 disable_sync_subtasks (bool): Disable tasks to wait for sub tasks
753 this is the default configuration. CAUTION do not enable this
754 unless you must.
755
756 Raises:
757 celery.exceptions.TimeoutError: if ``timeout`` isn't
758 :const:`None` and the operation takes longer than ``timeout``
759 seconds.
760 """
761 if disable_sync_subtasks:
762 assert_will_not_block()
763 time_start = time.monotonic()
764 remaining = None
765
766 if on_message is not None:
767 raise ImproperlyConfigured(
768 'Backend does not support on_message callback')
769
770 results = []
771 for result in self.results:

Callers 15

parse_dist_metaFunction · 0.45
_reqsFunction · 0.45
mainFunction · 0.45
shortenFunction · 0.45
get_abbrFunction · 0.45
resolveFunction · 0.45
settings.pyFile · 0.45
pyimplementationFunction · 0.45
strargvFunction · 0.45
create_moduleFunction · 0.45
get_compat_moduleFunction · 0.45
__init__Method · 0.45

Calls 5

assert_will_not_blockFunction · 0.85
TimeoutErrorClass · 0.85
callbackFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected