Ë
    3ýj2œ  ã                   ó  — d Z ddlZddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZmZmZ d	d
lmZmZ d	dlmZmZ d	dlmZ d	dlmZmZmZmZ d	dlm Z m!Z! 	 ddl"Z"dZ$dZ%d„ Z&ed„ «       Z'ed„ «       Z( G d„ d«      Z)ejT                   G d„ de)«      «       Z+ejT                   G d„ de)«      «       Z,ejT                   G d„ de,«      «       Z-ejT                   G d„ de+«      «       Z.dd„Z/y# e#$ r dZ"Y Œ—w xY w) z3Task results/state and results for groups of tasks.é    N)Údeque)Úcontextmanager)Úproxy)Úisoparse)Úcached_property)ÚThenableÚbarrierÚpromiseé   )Úcurrent_appÚstates)Ú_set_task_join_will_blockÚtask_join_will_block)Úapp_or_default)ÚImproperlyConfiguredÚIncompleteStreamÚTaskRevokedErrorÚTimeoutError)ÚDependencyGraphÚGraphFormatter)Ú
ResultBaseÚAsyncResultÚ	ResultSetÚGroupResultÚEagerResultÚresult_from_tuplezˆNever call result.get() within a task!
See https://docs.celeryq.dev/en/latest/userguide/tasks.html#avoid-launching-synchronous-subtasks
c                  ó6   — t        «       rt        t        «      ‚y ©N)r   ÚRuntimeErrorÚE_WOULDBLOCK© ó    úG/root/telegram-saas/.venv/lib/python3.12/site-packages/celery/result.pyÚassert_will_not_blockr$   %   s   € ÜÔÜœ<Ó(Ð(ð r"   c               #   óv   K  — t        «       } t        d«       	 d –— t        | «       y # t        | «       w xY w­w©NF©r   r   ©Úreset_values    r#   Úallow_join_resultr*   *   s/   è ø€ ä&Ó(€KÜ˜eÔ$ð/Ûä! +Õ.øÔ! +Õ.üó   ‚9™) �9©6¶9c               #   óv   K  — t        «       } t        d«       	 d –— t        | «       y # t        | «       w xY w­w©NTr'   r(   s    r#   Údenied_join_resultr.   4   s/   è ø€ ä&Ó(€KÜ˜dÔ#ð/Ûä! +Õ.øÔ! +Õ.ür+   c                   ó   — e Zd ZdZdZy)r   zBase class for results.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úparentr!   r"   r#   r   r   >   s   „ Ù!ð �Fr"   r   c                   ó¶  — e Zd ZdZdZeZdZdZ	 	 	 d8d„Ze	d„ «       Z
e
j                  d„ «       Z
d9d„Zd„ Zd„ Zd	„ Zd
„ Z	 	 d:d„Z	 	 d:d„Zdddddddddej(                  ej*                  fd„ZeZd„ Zd„ Zd;d„Zd„ Zd;d„Zd„ Zd„ Zd„ Zd„ Z d„ Z!d<d„Z"e"Z#d„ Z$d=d„Z% e&e'jP                  «      Z)d„ Z*d„ Z+d„ Z,d „ Z-d!„ Z.d"„ Z/d#„ Z0d$„ Z1e2d%„ «       Z3e	d&„ «       Z4e	d'„ «       Z5d(„ Z6d)„ Z7d*„ Z8d+„ Z9e	d,„ «       Z:e:Z;e	d-„ «       Z<e	d.„ «       Z=e=Z>e	d/„ «       Z?e?j                  d0„ «       Z?e	d1„ «       Z@e	d2„ «       ZAe	d3„ «       ZBe	d4„ «       ZCe	d5„ «       ZDe	d6„ «       ZEe	d7„ «       ZFy)>r   zxQuery task state.

    Arguments:
        id (str): See :attr:`id`.
        backend (Backend): See :attr:`backend`.
    Nc                 ó   — |€t        dt        |«      › �«      ‚t        |xs | j                  «      | _        || _        |xs | j                  j
                  | _        || _        t        | j                  d¬«      | _	        d | _
        d| _        y )Nz#AsyncResult requires valid id, not T©ÚweakF)Ú
ValueErrorÚtyper   ÚappÚidÚbackendr4   r
   Ú_on_fulfilledÚon_readyÚ_cacheÚ_ignored)Úselfr<   r=   Ú	task_namer;   r4   s         r#   Ú__init__zAsyncResult.__init__Y   s€   € ð ˆ:ÜØ5´d¸2³h°ZÐ@óBð Bä! #¢/¨¯©Ó2ˆŒØˆŒØÒ2 $§(¡(×"2Ñ"2ˆŒØˆŒÜ × 2Ñ 2¸Ô>ˆŒØˆŒØˆ�r"   c                 ó4   — t        | d«      r| j                  S y)z+If True, task result retrieval is disabled.rA   F)ÚhasattrrA   ©rB   s    r#   ÚignoredzAsyncResult.ignoredg   s   € ô �4˜Ô$Ø—=‘=Ð Ør"   c                 ó   — || _         y)z%Enable/disable task result retrieval.N)rA   )rB   Úvalues     r#   rH   zAsyncResult.ignoredn   s   € ð ˆ�r"   c                 ót   — | j                   j                  | |¬«       | j                  j                  ||«      S )Nr7   )r=   Úadd_pending_resultr?   Úthen©rB   ÚcallbackÚon_errorr8   s       r#   rM   zAsyncResult.thens   s0   € Ø�‰×'Ñ'¨°4Ð'Ô8Ø�}‰}×!Ñ! (¨HÓ5Ð5r"   c                 ó<   — | j                   j                  | «       |S r   ©r=   Úremove_pending_result©rB   Úresults     r#   r>   zAsyncResult._on_fulfilledw   s   € Ø�‰×*Ñ*¨4Ô0Øˆr"   c                 ó^   — | j                   }| j                  |xr |j                  «       fd fS r   )r4   r<   Úas_tuple)rB   r4   s     r#   rW   zAsyncResult.as_tuple{   s+   € Ø—‘ˆØ—‘˜Ò5 F§O¡OÓ$5Ð6¸Ð<Ð<r"   c                 óš   — g }| j                   }|j                  | j                  «       |�|j                  |j	                  «       «       |S )zReturn as a list of task IDs.)r4   Úappendr<   ÚextendÚas_list)rB   Úresultsr4   s      r#   r[   zAsyncResult.as_list   s>   € àˆØ—‘ˆØ�‰�t—w‘wÔØÐØ�N‰N˜6Ÿ>™>Ó+Ô,Øˆr"   c                 óÞ   — d| _         | j                  r| j                  j                  «        | j                  j	                  | «       | j                  j                  | j
                  «       y)z/Forget the result of this task and its parents.N)r@   r4   Úforgetr=   rS   r<   rG   s    r#   r^   zAsyncResult.forgetˆ   sH   € àˆŒØ�;Š;Ø�K‰K×ÑÔ à�‰×*Ñ*¨4Ô0Ø�‰×Ñ˜DŸG™GÕ$r"   c                 ón   — | j                   j                  j                  | j                  |||||¬«       y)aŠ  Send revoke signal to all workers.

        Any worker receiving the task, or having reserved the
        task, *must* ignore it.

        Arguments:
            terminate (bool): Also terminate the process currently working
                on the task (if any).
            signal (str): Name of signal to send to process if terminate.
                Default is TERM.
            wait (bool): Wait for replies from workers.
                The ``timeout`` argument specifies the seconds to wait.
                Disabled by default.
            timeout (float): Time in seconds to wait for replies when
                ``wait`` is enabled.
        ©Ú
connectionÚ	terminateÚsignalÚreplyÚtimeoutN)r;   ÚcontrolÚrevoker<   )rB   ra   rb   rc   Úwaitre   s         r#   rg   zAsyncResult.revoke‘   s3   € ð$ 	�‰×Ñ×Ñ §¡°JØ*3¸FØ&*°Gð 	 õ 	=r"   c                 óZ   — | j                   j                  j                  ||||||¬«       y)a7  Send revoke signal to all workers only for tasks with matching headers values.

        Any worker receiving the task, or having reserved the
        task, *must* ignore it.
        All header fields *must* match.

        Arguments:
            headers (dict[str, Union(str, list)]): Headers to match when revoking tasks.
            terminate (bool): Also terminate the process currently working
                on the task (if any).
            signal (str): Name of signal to send to process if terminate.
                Default is TERM.
            wait (bool): Wait for replies from workers.
                The ``timeout`` argument specifies the seconds to wait.
                Disabled by default.
            timeout (float): Time in seconds to wait for replies when
                ``wait`` is enabled.
        r`   N)r;   rf   Úrevoke_by_stamped_headers)rB   Úheadersra   rb   rc   rh   re   s          r#   rj   z%AsyncResult.revoke_by_stamped_headers§   s0   € ð( 	�‰×Ñ×2Ñ2°7ÀzØ=FÈvØ9=Àwð 	3õ 	Pr"   Tç      à?c           
      ó°  — | j                   ry|	r
t        «        t        «       }|r5|r3| j                  r't        | j                  d¬«      }| j	                  «        |r|j                  |«       | j                  r |r| j                  |¬«       | j                  S | j                  j                  | «       | j                  j                  | |||||||¬«      S )a6	  Wait until task is ready, and return its result.

        Warning:
           Waiting for tasks within a task may lead to deadlocks.
           Please read :ref:`task-synchronous-subtasks`.

        Warning:
           Backends use resources to store and transmit results. To ensure
           that resources are released, you must eventually call
           :meth:`~@AsyncResult.get` or :meth:`~@AsyncResult.forget` on
           EVERY :class:`~@AsyncResult` instance returned after calling
           a task.

        Arguments:
            timeout (float): How long to wait, in seconds, before the
                operation times out. This is the setting for the publisher
                (celery client) and is different from `timeout` parameter of
                `@app.task`, which is the setting for the worker. The task
                isn't terminated even if timeout occurs.
            propagate (bool): Re-raise exception if the task failed.
            interval (float): Time to wait (in seconds) before retrying to
                retrieve the result.  Note that this does not have any effect
                when using the RPC/redis result store backends, as they don't
                use polling.
            no_ack (bool): Enable amqp no ack (automatically acknowledge
                message).  If this is :const:`False` then the message will
                **not be acked**.
            follow_parents (bool): Re-raise any exception raised by
                parent tasks.
            disable_sync_subtasks (bool): Disable tasks to wait for sub tasks
                this is the default configuration. CAUTION do not enable this
                unless you must.

        Raises:
            celery.exceptions.TimeoutError: if `timeout` isn't
                :const:`None` and the result does not arrive within
                `timeout` seconds.
            Exception: If the remote call raised an exception then that
                exception will be re-raised in the caller process.

        Returns:
            Any: The task's return value on success. If the task failed and
                ``propagate`` is false, the raised exception instance is
                returned instead of being re-raised. If the task is configured
                with ``ignore_result=True``, ``None`` is returned without
                waiting.
        NTr7   )rO   )re   ÚintervalÚon_intervalÚno_ackÚ	propagaterO   Ú
on_message)rH   r$   r
   r4   Ú_maybe_reraise_parent_errorrM   r@   Úmaybe_throwrU   r=   rL   Úwait_for_pending)rB   re   rq   rn   rp   Úfollow_parentsrO   rr   ro   Údisable_sync_subtasksÚEXCEPTION_STATESÚPROPAGATE_STATESÚ_on_intervals                r#   ÚgetzAsyncResult.get¿   sÃ   € ðh �<Š<Øá Ü!Ô#Ü“yˆÙ™i¨D¯KªKÜ" 4×#CÑ#CÈ$ÔOˆLØ×,Ñ,Ô.ÙØ×Ñ˜kÔ*à�;Š;ÙØ× Ñ ¨(Ð Ô3Ø—;‘;Ðà�‰×'Ñ'¨Ô-Ø�|‰|×,Ñ,Ø˜'ØØ$ØØØØ!ð -ó 
ð 	
r"   c                 ór   — t        t        | j                  «       «      «      D ]  }|j                  «        Œ y r   )ÚreversedÚlistÚ_parentsrt   ©rB   Únodes     r#   rs   z'AsyncResult._maybe_reraise_parent_error  s-   € ÜœT $§-¡-£/Ó2Ó3ò 	ˆDØ×ÑÕñ	r"   c              #   óP   K  — | j                   }|r|–— |j                   }|rŒy y ­wr   ©r4   r€   s     r#   r   zAsyncResult._parents  s%   è ø€ Ø�{‰{ˆÙØŠJØ—;‘;ˆDô ùs   ‚!&¤&c              +   ól   K  — | j                  |¬«      D ]  \  }}| |j                  di |¤Žf–— Œ y­w)aô  Collect results as they return.

        Iterator, like :meth:`get` will wait for the task to complete,
        but will also follow :class:`AsyncResult` and :class:`ResultSet`
        returned by the task, yielding ``(result, value)`` tuples for each
        result in the tree.

        An example would be having the following tasks:

        .. code-block:: python

            from celery import group
            from proj.celery import app

            @app.task(trail=True)
            def A(how_many):
                return group(B.s(i) for i in range(how_many))()

            @app.task(trail=True)
            def B(i):
                return pow2.delay(i)

            @app.task(trail=True)
            def pow2(i):
                return i ** 2

        To collect only the values returned by leaf tasks, unpack each pair
        and select results with no children:

        .. code-block:: pycon

            >>> from proj.tasks import A

            >>> result = A.delay(10)
            >>> [value for child, value in result.collect()
            ...  if not child.children]
            [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

        Note:
            The ``Task.trail`` option must be enabled
            so that the list of children is stored in ``result.children``.
            This is the default but enabled explicitly for illustration.

        Yields:
            Tuple[AsyncResult, Any]: tuples containing the result instance
            of the child task, and the return value of that task.
        ©ÚintermediateNr!   ©Úiterdepsr{   )rB   r†   ÚkwargsÚ_ÚRs        r#   ÚcollectzAsyncResult.collect  s>   è ø€ ð` —M‘M¨|�MÓ<ò 	%‰DˆAˆqØ�U�Q—U‘U‘_˜V‘_Ð$Ó$ñ	%ùs   ‚24c                 óZ   — d }| j                  «       D ]  \  }}|j                  «       }Œ |S r   r‡   )rB   rJ   rŠ   r‹   s       r#   Úget_leafzAsyncResult.get_leafM  s0   € ØˆØ—M‘M“Oò 	‰DˆAˆqØ—E‘E“G‰Eð	àˆr"   c              #   óø   ‡K  — t        d | fg«      }| }|rb|j                  «       \  }Š|‰f–— ‰j                  «       r)|j                  ˆfd„‰j                  xs g D «       «       n|r
t        «       ‚|rŒay y ­w)Nc              3   ó&   •K  — | ]  }‰|f–— Œ
 y ­wr   r!   )Ú.0Úchildr�   s     €r#   ú	<genexpr>z'AsyncResult.iterdeps.<locals>.<genexpr>\  s   øè ø€ ÒL¨u˜d Eœ]ÑLùs   ƒ)r   ÚpopleftÚreadyrZ   Úchildrenr   )rB   r†   ÚstackÚis_incomplete_streamr4   r�   s        @r#   rˆ   zAsyncResult.iterdepsS  sq   øè ø€ Ü˜˜d�|�nÓ%ˆà#/Ð/ÐáØ Ÿ=™=›?‰LˆF�DØ˜$�,ÒØ�z‰zŒ|Ø—‘ÓL¸¿¹Ò8KÈÔLÕLá'Ü*Ó,Ð,ô ùs   ƒA4A:Á8A:c                 óL   — | j                   j                  | j                  «      S )a?  Return :const:`True` if a result exists in the backend for this task.

        This can be used to distinguish between a task that is truly
        pending (waiting for execution) and a task ID that has never
        been submitted or whose result has been forgotten/expired.

        Without this method, both cases return ``PENDING`` as the state,
        making them indistinguishable.

        .. versionadded:: 5.7.0

        Returns:
            bool: :const:`True` if the backend has a result stored for
                this task ID, :const:`False` otherwise.
        )r=   Útask_result_existsr<   rG   s    r#   ÚexistszAsyncResult.existsa  s   € ð  �|‰|×.Ñ.¨t¯w©wÓ7Ð7r"   c                 óF   — | j                   | j                  j                  v S )z¨Return :const:`True` if the task has executed.

        If the task is still running, pending, or is waiting
        for retry then :const:`False` is returned.
        )Ústater=   ÚREADY_STATESrG   s    r#   r•   zAsyncResult.readys  s   € ð �z‰z˜TŸ\™\×6Ñ6Ð6Ð6r"   c                 ó<   — | j                   t        j                  k(  S )z7Return :const:`True` if the task executed successfully.)r�   r   ÚSUCCESSrG   s    r#   Ú
successfulzAsyncResult.successful{  ó   € à�z‰zœVŸ^™^Ñ+Ð+r"   c                 ó<   — | j                   t        j                  k(  S )z(Return :const:`True` if the task failed.)r�   r   ÚFAILURErG   s    r#   ÚfailedzAsyncResult.failed  r¢   r"   c                 ó<   —  | j                   j                  |i |¤Ž y r   )r?   Úthrow©rB   Úargsr‰   s      r#   r§   zAsyncResult.throwƒ  s   € Øˆ�‰×Ñ˜TÐ, VÓ,r"   c                 ó   — | j                   €| j                  «       n| j                   }|d   |d   |j                  d«      }}}|t        j                  v r#|r!| j                  || j                  |«      «       |� || j                  |«       |S )NÚstatusrU   Ú	traceback)r@   Ú_get_task_metar{   r   ry   r§   Ú_to_remote_tracebackr<   )rB   rq   rO   Úcacher�   rJ   Útbs          r#   rt   zAsyncResult.maybe_throw†  s‚   € Ø)-¯©Ð)<�×#Ñ#Ô%À$Ç+Á+ˆà�(‰O˜U 8™_¨e¯i©i¸Ó.Dð ˆuˆà”F×+Ñ+Ñ+±	Ø�J‰J�u˜d×7Ñ7¸Ó;Ô<ØÐÙ�T—W‘W˜eÔ$Øˆr"   c                 ó²   — |rUt         �N| j                  j                  j                  r-t         j                  j                  |«      j                  «       S y y y r   )Útblibr;   ÚconfÚtask_remote_tracebacksÚ	TracebackÚfrom_stringÚas_traceback)rB   r°   s     r#   r®   z AsyncResult._to_remote_traceback‘  sC   € Ù”%Ð#¨¯©¯©×(LÒ(LÜ—?‘?×.Ñ.¨rÓ2×?Ñ?ÓAÐAð )MÐ#ˆ2r"   c                 óÐ   — t        |xs t        | j                  d¬«      ¬«      }| j                  |¬«      D ]+  \  }}|j	                  |«       |sŒ|j                  ||«       Œ- |S )NÚoval)ÚrootÚshape)Ú	formatterr…   )r   r   r<   rˆ   Úadd_arcÚadd_edge)rB   r†   r¼   Úgraphr4   r�   s         r#   Úbuild_graphzAsyncResult.build_graph•  sc   € ÜØÒM¤>°t·w±wÀfÔ#Mô
ˆð !ŸM™M°|˜MÓDò 	-‰LˆF�DØ�M‰M˜$ÔÚØ—‘˜v tÕ,ð	-ð ˆr"   c                 ó,   — t        | j                  «      S ©z`str(self) -> self.id`.©Ústrr<   rG   s    r#   Ú__str__zAsyncResult.__str__¡  ó   € ä�4—7‘7‹|Ðr"   c                 ó,   — t        | j                  «      S ©z`hash(self) -> hash(self.id)`.©Úhashr<   rG   s    r#   Ú__hash__zAsyncResult.__hash__¥  ó   € ä�D—G‘G‹}Ðr"   c                 óN   — dt        | «      j                  › d| j                  › d�S )Nú<ú: ú>)r:   r0   r<   rG   s    r#   Ú__repr__zAsyncResult.__repr__©  s&   € Ø”4˜“:×&Ñ&Ð' r¨$¯'©'¨°!Ð4Ð4r"   c                 óž   — t        |t        «      r|j                  | j                  k(  S t        |t        «      r|| j                  k(  S t        S r   )Ú
isinstancer   r<   rÄ   ÚNotImplemented©rB   Úothers     r#   Ú__eq__zAsyncResult.__eq__¬  s>   € Ü�eœ[Ô)Ø—8‘8˜tŸw™wÑ&Ð&Ü˜œsÔ#Ø˜DŸG™GÑ#Ð#ÜÐr"   c                 ó|   — | j                  | j                  | j                  d | j                  | j                  «      S r   )Ú	__class__r<   r=   r;   r4   rG   s    r#   Ú__copy__zAsyncResult.__copy__³  s.   € Ø�~‰~Ø�G‰G�T—\‘\ 4¨¯©°4·;±;ó
ð 	
r"   c                 ó:   — | j                   | j                  «       fS r   ©rÙ   Ú__reduce_args__rG   s    r#   Ú
__reduce__zAsyncResult.__reduce__¸  ó   € Ø�~‰~˜t×3Ñ3Ó5Ð5Ð5r"   c                 óL   — | j                   | j                  d d | j                  fS r   )r<   r=   r4   rG   s    r#   rÝ   zAsyncResult.__reduce_args__»  s   € Ø�w‰w˜Ÿ™ d¨D°$·+±+Ð=Ð=r"   c                 óT   — | j                   �| j                   j                  | «       yy)z9Cancel pending operations when the instance is destroyed.NrR   rG   s    r#   Ú__del__zAsyncResult.__del__¾  s#   € à�<‰<Ð#Ø�L‰L×.Ñ.¨tÕ4ð $r"   c                 ó"   — | j                  «       S r   )rÀ   rG   s    r#   r¿   zAsyncResult.graphÃ  s   € à×ÑÓ!Ð!r"   c                 ó.   — | j                   j                  S r   )r=   Úsupports_native_joinrG   s    r#   rå   z AsyncResult.supports_native_joinÇ  s   € à�|‰|×0Ñ0Ð0r"   c                 ó@   — | j                  «       j                  d«      S ©Nr–   ©r­   r{   rG   s    r#   r–   zAsyncResult.childrenË  s   € à×"Ñ"Ó$×(Ñ(¨Ó4Ð4r"   c                 ó²   — |rT|d   }|t         j                  v r=| j                  | j                  j	                  |«      «      }| j                  | «       |S |S )Nr«   )r   rž   Ú
_set_cacher=   Úmeta_from_decodedr?   )rB   Úmetar�   Úds       r#   Ú_maybe_set_cachezAsyncResult._maybe_set_cacheÏ  sO   € ÙØ˜‘NˆEØœ×+Ñ+Ñ+Ø—O‘O D§L¡L×$BÑ$BÀ4Ó$HÓI�Ø—‘˜dÔ#Ø�Øˆr"   c                 óš   — | j                   €4| j                  | j                  j                  | j                  «      «      S | j                   S r   )r@   rî   r=   Úget_task_metar<   rG   s    r#   r­   zAsyncResult._get_task_metaØ  s:   € Ø�;‰;ÐØ×(Ñ(¨¯©×)CÑ)CÀDÇGÁGÓ)LÓMÐMØ�{‰{Ðr"   c                 ó6   — t        | j                  «       g«      S r   )Úiterr­   )rB   r‰   s     r#   Ú
_iter_metazAsyncResult._iter_metaÝ  s   € Ü�T×(Ñ(Ó*Ð+Ó,Ð,r"   c                 ó’   — |j                  d«      }|r'|D �cg c]  }t        || j                  «      ‘Œ c}|d<   || _        |S c c}w rç   )r{   r   r;   r@   )rB   rí   r–   r’   s       r#   rê   zAsyncResult._set_cacheà  sK   € Ø—5‘5˜Ó$ˆÙà@HöØ7<Ô! %¨¯©Õ2òˆAˆj‰Mð ˆŒØˆùò	s   ˜Ac                 ó(   — | j                  «       d   S )zÕTask return value.

        Note:
            When the task has been executed, this contains the return value.
            If the task raised an exception, this will be the exception
            instance.
        rU   ©r­   rG   s    r#   rU   zAsyncResult.resulté  s   € ð ×"Ñ"Ó$ XÑ.Ð.r"   c                 ó@   — | j                  «       j                  d«      S )z#Get the traceback of a failed task.r¬   rè   rG   s    r#   r¬   zAsyncResult.tracebackõ  s   € ð ×"Ñ"Ó$×(Ñ(¨Ó5Ð5r"   c                 ó(   — | j                  «       d   S )a   The tasks current state.

        Possible values includes:

            *PENDING*

                The task is waiting for execution.

            *STARTED*

                The task has been started.

            *RETRY*

                The task is to be retried, possibly because of failure.

            *FAILURE*

                The task raised an exception, or has exceeded the retry limit.
                The :attr:`result` attribute then contains the
                exception raised by the task.

            *SUCCESS*

                The task executed successfully.  The :attr:`result` attribute
                then contains the tasks return value.
        r«   rö   rG   s    r#   r�   zAsyncResult.stateú  s   € ð: ×"Ñ"Ó$ XÑ.Ð.r"   c                 ó   — | j                   S )zCompat. alias to :attr:`id`.©r<   rG   s    r#   Útask_idzAsyncResult.task_id  s   € ð �w‰wˆr"   c                 ó   — || _         y r   rú   )rB   r<   s     r#   rû   zAsyncResult.task_id  s	   € àˆ�r"   c                 ó@   — | j                  «       j                  d«      S )NÚnamerè   rG   s    r#   rþ   zAsyncResult.name#  ó   € à×"Ñ"Ó$×(Ñ(¨Ó0Ð0r"   c                 ó@   — | j                  «       j                  d«      S )Nr©   rè   rG   s    r#   r©   zAsyncResult.args'  rÿ   r"   c                 ó@   — | j                  «       j                  d«      S )Nr‰   rè   rG   s    r#   r‰   zAsyncResult.kwargs+  ó   € à×"Ñ"Ó$×(Ñ(¨Ó2Ð2r"   c                 ó@   — | j                  «       j                  d«      S )NÚworkerrè   rG   s    r#   r  zAsyncResult.worker/  r  r"   c                 ó’   — | j                  «       j                  d«      }|r%t        |t        j                  «      st	        |«      S |S )zUTC date and time.Ú	date_done)r­   r{   rÓ   Údatetimer   )rB   r  s     r#   r  zAsyncResult.date_done3  s@   € ð ×'Ñ'Ó)×-Ñ-¨kÓ:ˆ	ÙœZ¨	´8×3DÑ3DÔEÜ˜IÓ&Ð&ØÐr"   c                 ó@   — | j                  «       j                  d«      S )NÚretriesrè   rG   s    r#   r	  zAsyncResult.retries;  s   € à×"Ñ"Ó$×(Ñ(¨Ó3Ð3r"   c                 ó@   — | j                  «       j                  d«      S )NÚqueuerè   rG   s    r#   r  zAsyncResult.queue?  s   € à×"Ñ"Ó$×(Ñ(¨Ó1Ð1r"   )NNNNr&   ©NFNFN)F)TN)FN)Gr0   r1   r2   r3   r;   r   r<   r=   rD   ÚpropertyrH   ÚsetterrM   r>   rW   r[   r^   rg   rj   r   rx   ry   r{   rh   rs   r   rŒ   rŽ   rˆ   r›   r•   r¡   r¥   r§   rt   Úmaybe_reraiser®   rÀ   ÚclassmethodÚtypesÚGenericAliasÚ__class_getitem__rÅ   rË   rÑ   r×   rÚ   rÞ   rÝ   râ   r   r¿   rå   r–   rî   r­   ró   rê   rU   Úinfor¬   r�   r«   rû   rþ   r©   r‰   r  r  r	  r  r!   r"   r#   r   r   E   sž  „ ñð €Cð  €Lð 
€Bð €Gà#'ØØ"&óð ñó ðð ‡^�^ñó ðó6òò=òò%ð ?CØ#'ó=ð, [_Ø6:óPð0 ¨$¸Ø¨°tÈØ°DØ#×4Ñ4Ø#×4Ñ4ó	N
ð^ €Dòòó1%òfó-ò8ò$7ò,ò,ò-óð  €MòBóñ $ E×$6Ñ$6Ó7Ðòòò5òò
ò
6ò>ò5ð
 ñ"ó ð"ð ñ1ó ð1ð ñ5ó ð5òòò
-òð ñ/ó ð/ð €Dàñ6ó ð6ð ñ/ó ð/ð: €Fàñó ðð ‡^�^ñó ðð ñ1ó ð1ð ñ1ó ð1ð ñ3ó ð3ð ñ3ó ð3ð ñó ðð ñ4ó ð4ð ñ2ó ñ2r"   r   c                   óD  — e Zd ZdZdZdZd#d„Zd„ Zd„ Zd„ Z	d„ Z
d„ Zd	„ Zd
„ Zd„ Zd„ Zd$d„ZeZd„ Zd„ Zd„ Zd„ Z	 	 d%d„Zd„ Zd„ Z	 	 	 d&d„Z	 	 	 d&d„Zd'd„Z	 	 d(d„Z	 	 	 	 d)d„Zd„ Zd„ Zd„ Z d„ Z!d„ Z"e#d„ «       Z$e#d „ «       Z%e%jL                  d!„ «       Z%e#d"„ «       Z'y)*r   zpA collection of results.

    Arguments:
        results (Sequence[AsyncResult]): List of result instances.
    Nc                 ó\   — || _         || _        | j                  |xs t        |«      «       y r   )Ú_appr\   Ú_set_ready_barrierr	   )rB   r\   r;   Úready_barrierr‰   s        r#   rD   zResultSet.__init__Q  s(   € ØˆŒ	ØˆŒØ×Ñ Ò A´¸Ó1AÕBr"   c                 óÂ   — t        t        | «      f¬«      | _        || _        | j                  r1| j                  j	                  t        | j
                  d¬«      «       y y )N)r©   Tr7   )r
   r   r?   Ú_on_fullrM   Ú	_on_ready)rB   r  s     r#   r  zResultSet._set_ready_barrierV  sD   € Ü¤e¨D£k ^Ô4ˆŒØ%ˆŒØ�=Š=Ø�M‰M×Ñœw t§~¡~¸DÔAÕBð r"   c                 ó†  — || j                   vr³| j                   j                  |«       | j                  r‹| j                  j                  j                  rO| j                  t        «       «       | j                  j                  |«       | j                  j                  «        y| j                  j                  |«       yyy)zvAdd :class:`AsyncResult` as a new member of the set.

        Does nothing if the result is already a member.
        N)	r\   rY   r  Úpr•   r  r	   ÚaddÚfinalizerT   s     r#   r  zResultSet.add\  sŠ   € ð
 ˜Ÿ™Ñ%Ø�L‰L×Ñ Ô'Ø�}Š}Ø—=‘=—?‘?×(Ò(ð ×+Ñ+¬G«IÔ6Ø—M‘M×%Ñ% fÔ-Ø—M‘M×*Ñ*Õ,à—M‘M×%Ñ% fÕ-ð ð &r"   c                 óR   — | j                   j                  r| j                  «        y y r   )r=   Úis_asyncr?   rG   s    r#   r  zResultSet._on_readyr  s   € Ø�<‰<× Ò Ø�M‰M�Oð !r"   c                 óÂ   — t        |t        «      r| j                  j                  |«      }	 | j                  j                  |«       y# t        $ r t        |«      ‚w xY w)z~Remove result from the set; it must be a member.

        Raises:
            KeyError: if the result isn't a member.
        N)rÓ   rÄ   r;   r   r\   Úremover9   ÚKeyErrorrT   s     r#   r$  zResultSet.removev  sS   € ô �fœcÔ"Ø—X‘X×)Ñ)¨&Ó1ˆFð	#Ø�L‰L×Ñ Õ'øÜò 	#Ü˜6Ó"Ð"ð	#ús   ­A	 Á	Ac                 óF   — 	 | j                  |«       y# t        $ r Y yw xY w)zbRemove result from the set if it is a member.

        Does nothing if it's not a member.
        N)r$  r%  rT   s     r#   ÚdiscardzResultSet.discardƒ  s%   € ð
	Ø�K‰K˜ÕøÜò 	Ùð	ús   ‚ ”	 Ÿ c                 óN   ‡ — ‰ j                   j                  ˆ fd„|D «       «       y)z Extend from iterable of results.c              3   ó@   •K  — | ]  }|‰j                   vsŒ|–— Œ y ­wr   ©r\   )r‘   ÚrrB   s     €r#   r“   z#ResultSet.update.<locals>.<genexpr>�  s   øè ø€ ÒH !°!¸4¿<¹<Ò2GœAÑHùs   ƒ—N)r\   rZ   )rB   r\   s   ` r#   ÚupdatezResultSet.update�  s   ø€ à�‰×ÑÓH wÔHÕHr"   c                 ó"   — g | j                   dd y)z!Remove all results from this set.Nr*  rG   s    r#   ÚclearzResultSet.clear‘  s   € àˆ�‰‘Q‰r"   c                 ó:   — t        d„ | j                  D «       «      S )z²Return true if all tasks successful.

        Returns:
            bool: true if all of the tasks finished
                successfully (i.e. didn't raise an exception).
        c              3   ó<   K  — | ]  }|j                  «       –— Œ y ­wr   )r¡   ©r‘   rU   s     r#   r“   z'ResultSet.successful.<locals>.<genexpr>œ  s   è ø€ ÒB¨6�6×$Ñ$×&ÑBùó   ‚©Úallr\   rG   s    r#   r¡   zResultSet.successful•  s   € ô ÑB°T·\±\ÔBÓBÐBr"   c                 ó:   — t        d„ | j                  D «       «      S )z¡Return true if any of the tasks failed.

        Returns:
            bool: true if one of the tasks failed.
                (i.e., raised an exception)
        c              3   ó<   K  — | ]  }|j                  «       –— Œ y ­wr   )r¥   r1  s     r#   r“   z#ResultSet.failed.<locals>.<genexpr>¥  s   è ø€ Ò> v�6—=‘=—?Ñ>ùr2  ©Úanyr\   rG   s    r#   r¥   zResultSet.failedž  s   € ô Ñ>°·±Ô>Ó>Ð>r"   c                 óL   — | j                   D ]  }|j                  ||¬«       Œ y )N)rO   rq   )r\   rt   )rB   rO   rq   rU   s       r#   rt   zResultSet.maybe_throw§  s*   € Ø—l‘lò 	GˆFØ×Ñ¨¸IÐÕFñ	Gr"   c                 ó:   — t        d„ | j                  D «       «      S )z¦Return true if any of the tasks are incomplete.

        Returns:
            bool: true if one of the tasks are still
                waiting for execution.
        c              3   ó>   K  — | ]  }|j                  «        –— Œ y ­wr   ©r•   r1  s     r#   r“   z$ResultSet.waiting.<locals>.<genexpr>³  s   è ø€ ÒA¨&�v—|‘|“~Ô%ÑAùs   ‚r7  rG   s    r#   ÚwaitingzResultSet.waiting¬  s   € ô ÑA°D·L±LÔAÓAÐAr"   c                 ó:   — t        d„ | j                  D «       «      S )z˜Did all of the tasks complete? (either by success of failure).

        Returns:
            bool: true if all of the tasks have been executed.
        c              3   ó<   K  — | ]  }|j                  «       –— Œ y ­wr   r<  r1  s     r#   r“   z"ResultSet.ready.<locals>.<genexpr>»  s   è ø€ Ò= f�6—<‘<—>Ñ=ùr2  r3  rG   s    r#   r•   zResultSet.readyµ  s   € ô Ñ=°·±Ô=Ó=Ð=r"   c                 ó:   — t        d„ | j                  D «       «      S )a  Task completion count.

        Note that `complete` means `successful` in this context. In other words, the
        return value of this method is the number of ``successful`` tasks.

        Returns:
            int: the number of complete (i.e. successful) tasks.
        c              3   óN   K  — | ]  }t        |j                  «       «      –— Œ y ­wr   )Úintr¡   r1  s     r#   r“   z,ResultSet.completed_count.<locals>.<genexpr>Æ  s   è ø€ ÒG°”3�v×(Ñ(Ó*×+ÑGùs   ‚#%)Úsumr\   rG   s    r#   Úcompleted_countzResultSet.completed_count½  s   € ô ÑG¸$¿,¹,ÔGÓGÐGr"   c                 óF   — | j                   D ]  }|j                  «        Œ y)z?Forget about (and possible remove the result of) all the tasks.N)r\   r^   rT   s     r#   r^   zResultSet.forgetÈ  s   € à—l‘lò 	ˆFØ�M‰M�Oñ	r"   c                 ó¨   — | j                   j                  j                  | j                  D �cg c]  }|j                  ‘Œ c}|||||¬«       yc c}w )a[  Send revoke signal to all workers for all tasks in the set.

        Arguments:
            terminate (bool): Also terminate the process currently working
                on the task (if any).
            signal (str): Name of signal to send to process if terminate.
                Default is TERM.
            wait (bool): Wait for replies from worker.
                The ``timeout`` argument specifies the number of seconds
                to wait.  Disabled by default.
            timeout (float): Time in seconds to wait for replies when
                the ``wait`` argument is enabled.
        )ra   re   rb   rc   rd   N)r;   rf   rg   r\   r<   )rB   ra   rb   rc   rh   re   r+  s          r#   rg   zResultSet.revokeÍ  sF   € ð 	�‰×Ñ×Ñ¨t¯|©|Ö <¨! §£Ò <Ø+5¸wØ*3¸FÈ$ð 	 õ 	PùÒ <s   ®Ac                 ó,   — t        | j                  «      S r   )rò   r\   rG   s    r#   Ú__iter__zResultSet.__iter__à  s   € Ü�D—L‘LÓ!Ð!r"   c                 ó    — | j                   |   S )z`res[i] -> res.results[i]`.r*  )rB   Úindexs     r#   Ú__getitem__zResultSet.__getitem__ã  s   € à�|‰|˜EÑ"Ð"r"   c	           
      óf   —  | j                   r| j                  n| j                  ||||||||¬«      S )zÆSee :meth:`join`.

        This is here for API compatibility with :class:`AsyncResult`,
        in addition it uses :meth:`join_native` if available for the
        current result backend.
        )re   rq   rn   rO   rp   rr   rw   ro   )rå   Újoin_nativeÚjoin)	rB   re   rq   rn   rO   rp   rr   rw   ro   s	            r#   r{   zResultSet.getç  s=   € ð M D×$=Ò$=�× Ò À4Ç9Á9Ø yØ¨¸Ø!Ð9NØ#ô	
ð 	
r"   c	           	      óV  — |r
t        «        t        j                  «       }	d}
|�t        d«      ‚g }| j                  D ]h  }d}
|�$t        |t        j                  «       |	z
  z
  d«      }
|j                  |
|||||¬«      }|r ||j                  |«       ŒX|j                  |«       Œj |S )a<  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.

        Warning:
            Waiting for tasks within a task may lead to deadlocks.
            Please see :ref:`task-synchronous-subtasks`.

        Arguments:
            timeout (float): The number of seconds to wait for results
                before the operation times out.
            propagate (bool): If any of the tasks raises an exception,
                the exception will be re-raised when this flag is set.
            interval (float): Time to wait (in seconds) before retrying to
                retrieve a result from the set.  Note that this does not have
                any effect when using the amqp result store backend,
                as it does not use polling.
            callback (Callable): Optional callback to be called for every
                result received.  Must have signature ``(task_id, value)``
                No results will be returned by this function if a callback
                is specified.  The order of results is also arbitrary when a
                callback is used.  To get access to the result object for
                a particular id you'll have to generate an index first:
                ``index = {r.id: r for r in gres.results.values()}``
                Or you can create new result objects on the fly:
                ``result = app.AsyncResult(task_id)`` (both will
                take advantage of the backend cache anyway).
            no_ack (bool): Automatic message acknowledgment (Note that if this
                is set to :const:`False` then the messages
                *will not be acknowledged*).
            disable_sync_subtasks (bool): Disable tasks to wait for sub tasks
                this is the default configuration. CAUTION do not enable this
                unless you must.

        Raises:
            celery.exceptions.TimeoutError: if ``timeout`` isn't
                :const:`None` and the operation takes longer than ``timeout``
                seconds.

        Returns:
            list: A list of task return values in the same order as the
                results in this set. If ``callback`` is provided, the
                callback handles each value and no aggregated results are
                returned (``join()`` returns an empty list; note that
                :meth:`join_native`, which :meth:`get` may delegate to,
                returns ``None`` in that case). If any task failed and
                ``propagate`` is false, the corresponding position in the
                list contains the exception instance instead of a return
                value.
        Nz,Backend does not support on_message callbackg        )re   rq   rn   rp   ro   rw   )	r$   ÚtimeÚ	monotonicr   r\   Úmaxr{   r<   rY   )rB   re   rq   rn   rO   rp   rr   rw   ro   Ú
time_startÚ	remainingr\   rU   rJ   s                 r#   rN  zResultSet.join÷  sÃ   € ñt !Ü!Ô#Ü—^‘^Ó%ˆ
Øˆ	àÐ!Ü&Ø>ó@ð @ð ˆØ—l‘lò 	&ˆFØˆIØÐ"ô   ¬4¯>©>Ó+;¸jÑ+HÑ IÈ3ÓO�	Ø—J‘JØ!¨YØ!¨&¸kØ&;ð ó ˆEñ
 Ù˜Ÿ™ EÕ*à—‘˜uÕ%ð	&ð ˆr"   c                 ó:   — | j                   j                  ||«      S r   ©r?   rM   rN   s       r#   rM   zResultSet.thenL  ó   € Ø�}‰}×!Ñ! (¨HÓ5Ð5r"   c                 óx   — | j                   j                  «        | j                  j                  | |||||¬«      S )a0  Backend optimized version of :meth:`iterate`.

        .. versionadded:: 2.2

        Note that this does not support collecting the results
        for different task types using different backends.

        This is currently only supported by the amqp, Redis and cache
        result backends.
        )re   rn   rp   rr   ro   )r  r   r=   Úiter_native)rB   re   rn   rp   rr   ro   s         r#   rY  zResultSet.iter_nativeO  s?   € ð 	�‰×ÑÔ Ø�|‰|×'Ñ'ØØ h°vØ!¨{ð (ó 
ð 	
r"   c	                 ó  — |r
t        «        |rdn2t        | j                  «      D �	�
ci c]  \  }	}
|
j                  |	“Œ c}
}	}|rdn!t	        t        | «      «      D �cg c]  }d‘Œ c}}| j                  |||||«      D ]s  \  }}t        |t        «      r,g }|D ]$  }|j                  |j                  ||¬«      «       Œ& n|d   }|r|d   t        j                  v r|‚|r
 |||«       Œl||||   <   Œu |S c c}
}	w c c}w )a-  Backend optimized version of :meth:`join`.

        .. versionadded:: 2.2

        Note that this does not support collecting the results
        for different task types using different backends.

        This is currently only supported by the amqp, Redis and cache
        result backends.
        N)rq   rw   rU   r«   )r$   Ú	enumerater\   r<   ÚrangeÚlenrY  rÓ   r~   rY   r{   r   ry   )rB   re   rq   rn   rO   rp   rr   ro   rw   ÚirU   Úorder_indexrŠ   Úaccrû   rì   rJ   Úchildren_results                     r#   rM  zResultSet.join_nativeb  s  € ñ !Ü!Ô#Ù&‘dÜ*3°D·L±LÓ*A÷-
Ù&˜Q ˆF�I‰I�q‰Ló-
ˆñ ‰d´5¼¸T»Ó3CÖ$D¨a¢TÒ$DˆØ!×-Ñ-¨g°xÀØ.8¸+óGò 	2‰MˆG�Tä˜$¤Ô%Ø�Ø'+ò �OØ—L‘L ×!4Ñ!4Ø"+Ø.Cð "5ó "õ ñð ˜X™�Ù  h¡´6×3JÑ3JÑ!JØ�KÙÙ˜ %Õ(à,1��K Ñ(Ò)ð!	2ð" ˆ
ùó+-
ùò %Es   ©C7Á	C=c                 óœ   — d„  | j                   j                  | j                  D �ch c]  }|j                  ’Œ c}fddi|¤ŽD «       S c c}w )Nc              3   ó&   K  — | ]	  \  }}|–— Œ y ­wr   r!   )r‘   rŠ   rì   s      r#   r“   z'ResultSet._iter_meta.<locals>.<genexpr>Š  s   è ø€ ò ™˜˜D”ñ ùs   ‚Úmax_iterationsr   )r=   Úget_manyr\   r<   )rB   r‰   r+  s      r#   ró   zResultSet._iter_meta‰  sN   € ñÐ$9 D§L¡L×$9Ñ$9ØŸ<™<Ö(�aˆQ�T‹TÒ(ñ%
Ø9:ð%
Ø>Dñ%
ô ð 	ùÚ(s   §A	
c                 ó(   — d„ | j                   D «       S )Nc              3   ó¢   K  — | ]G  }|j                   j                  |j                  «      r |j                  t        j
                  v r|–— ŒI y ­wr   )r=   Ú	is_cachedr<   r�   r   ry   )r‘   Úress     r#   r“   z0ResultSet._failed_join_report.<locals>.<genexpr>�  s?   è ø€ ò 6˜Ø—;‘;×(Ñ(¨¯©Ô0Ø—	‘	œV×4Ñ4Ñ4ô ñ 6ùs   ‚AAr*  rG   s    r#   Ú_failed_join_reportzResultSet._failed_join_reportŽ  s   € ñ6˜tŸ|™|ô 6ð 	6r"   c                 ó,   — t        | j                  «      S r   )r]  r\   rG   s    r#   Ú__len__zResultSet.__len__“  s   € Ü�4—<‘<Ó Ð r"   c                 ó`   — t        |t        «      r|j                  | j                  k(  S t        S r   )rÓ   r   r\   rÔ   rÕ   s     r#   r×   zResultSet.__eq__–  s%   € Ü�eœYÔ'Ø—=‘= D§L¡LÑ0Ð0ÜÐr"   c                 óz   — dt        | «      j                  › ddj                  d„ | j                  D «       «      › d�S )NrÎ   z: [ú, c              3   ó4   K  — | ]  }|j                   –— Œ y ­wr   rú   ©r‘   r+  s     r#   r“   z%ResultSet.__repr__.<locals>.<genexpr>œ  s   è ø€ Ò4P¸a°Q·TµTÑ4Pùó   ‚ú]>)r:   r0   rN  r\   rG   s    r#   rÑ   zResultSet.__repr__›  s7   € Ø”4˜“:×&Ñ&Ð' s¨4¯9©9Ñ4PÀ4Ç<Á<Ô4PÓ+PÐ*QÐQSÐTÐTr"   c                 óT   — 	 | j                   d   j                  S # t        $ r Y y w xY w©Nr   )r\   rå   Ú
IndexErrorrG   s    r#   rå   zResultSet.supports_native_joinž  s-   € ð	Ø—<‘< ‘?×7Ñ7Ð7øÜò 	Ùð	ús   ‚ ›	'¦'c                 ó®   — | j                   €>| j                  r| j                  d   j                  nt        j                  «       | _         | j                   S ru  )r  r\   r;   r   Ú_get_current_objectrG   s    r#   r;   zResultSet.app¥  s@   € à�9‰9ÐØ04·²˜Ÿ™ a™×,Ò,Ü$×8Ñ8Ó:ð ŒIà�y‰yÐr"   c                 ó   — || _         y r   )r  )rB   r;   s     r#   r;   zResultSet.app¬  s	   € àˆ�	r"   c                 óx   — | j                   r| j                   j                  S | j                  d   j                  S ru  )r;   r=   r\   rG   s    r#   r=   zResultSet.backend°  s+   € à#'§8¢8ˆt�x‰x×ÑÐH°·±¸a±×1HÑ1HÐHr"   ©NNr-   r  )NTrl   NTNTNr&   )Nrl   TNN)NTrl   NTNNT)(r0   r1   r2   r3   r  r\   rD   r  r  r  r$  r'  r,  r.  r¡   r¥   rt   r  r=  r•   rD  r^   rg   rH  rK  r{   rN  rM   rY  rM  ró   rj  rl  r×   rÑ   r  rå   r;   r  r=   r!   r"   r#   r   r   D  s@  „ ñð €Dð €GóCò
Cò.ò,ò#òòIòòCò?óGð  €MòBò>ò	Hòð
 ?CØ#'óPò&"ò#ð :=Ø37Ø48ó
ð  ;>Ø48Ø59óSój6ð >BØ15ó
ð& 37Ø8<Ø15Ø*.ó%òNò
6ò
!òò
Uð ñó ðð ñó ðð 	‡Z�Zñó ðð ñIó ñIr"   r   c                   óœ   ‡ — e Zd ZdZdZdZdˆ fd„	Zˆ fd„Zdd„Zdd„Z	d„ Z
d„ Zd	„ ZeZd
„ Zd„ Zd„ Zd„ Zd„ Zed„ «       Zedd„«       Zˆ xZS )r   az  Like :class:`ResultSet`, but with an associated id.

    This type is returned by :class:`~celery.group`.

    It enables inspection of the tasks state and return values as
    a single entity.

    Arguments:
        id (str): The id of the group.
        results (Sequence[AsyncResult]): List of result instances.
        parent (ResultBase): Parent result of this group.
    Nc                 óB   •— || _         || _        t        ‰| �  |fi |¤Ž y r   )r<   r4   ÚsuperrD   )rB   r<   r\   r4   r‰   rÙ   s        €r#   rD   zGroupResult.__init__Ê  s#   ø€ ØˆŒØˆŒÜ‰Ñ˜Ñ+ FÓ+r"   c                 óX   •— | j                   j                  | «       t        ‰| �  «        y r   )r=   rS   r~  r  )rB   rÙ   s    €r#   r  zGroupResult._on_readyÏ  s    ø€ Ø�‰×*Ñ*¨4Ô0Ü‰ÑÕr"   c                 ój   — |xs | j                   j                  j                  | j                  | «      S )zãSave group-result for later retrieval using :meth:`restore`.

        Example:
            >>> def save_and_restore(result):
            ...     result.save()
            ...     result = GroupResult.restore(result.id)
        )r;   r=   Ú
save_groupr<   ©rB   r=   s     r#   ÚsavezGroupResult.saveÓ  s*   € ð Ò+˜4Ÿ8™8×+Ñ+×7Ñ7¸¿¹ÀÓFÐFr"   c                 ój   — |xs | j                   j                  j                  | j                  «       y)z.Remove this result if it was previously saved.N)r;   r=   Údelete_groupr<   r‚  s     r#   ÚdeletezGroupResult.deleteÝ  s#   € à	Ò	$�D—H‘H×$Ñ$×2Ñ2°4·7±7Õ;r"   c                 ó:   — | j                   | j                  «       fS r   rÜ   rG   s    r#   rÞ   zGroupResult.__reduce__á  rß   r"   c                 ó2   — | j                   | j                  fS r   )r<   r\   rG   s    r#   rÝ   zGroupResult.__reduce_args__ä  s   € Ø�w‰w˜Ÿ™Ð$Ð$r"   c                 óH   — t        | j                  xs | j                  «      S r   )Úboolr<   r\   rG   s    r#   Ú__bool__zGroupResult.__bool__ç  s   € Ü�D—G‘GÒ+˜tŸ|™|Ó,Ð,r"   c                 ó
  — t        |t        «      rO|j                  | j                  k(  xr4 |j                  | j                  k(  xr |j                  | j                  k(  S t        |t
        «      r|| j                  k(  S t        S r   )rÓ   r   r<   r\   r4   rÄ   rÔ   rÕ   s     r#   r×   zGroupResult.__eq__ë  sl   € Ü�eœ[Ô)à—‘˜DŸG™GÑ#ò ,Ø—‘ §¡Ñ-ò,à—‘ §¡Ñ+ðô
 ˜œsÔ#Ø˜DŸG™GÑ#Ð#ÜÐr"   c           	      ó”   — dt        | «      j                  › d| j                  › ddj                  d„ | j                  D «       «      › d�S )NrÎ   rÏ   z [ro  c              3   ó4   K  — | ]  }|j                   –— Œ y ­wr   rú   rq  s     r#   r“   z'GroupResult.__repr__.<locals>.<genexpr>÷  s   è ø€ Ò>ZÈ¸q¿t½tÑ>Zùrr  rs  )r:   r0   r<   rN  r\   rG   s    r#   rÑ   zGroupResult.__repr__ö  sA   € Ø”4˜“:×&Ñ&Ð' r¨$¯'©'¨°"°T·Y±YÑ>ZÈTÏ\É\Ô>ZÓ5ZÐ4[Ð[]Ð^Ð^r"   c                 ó,   — t        | j                  «      S rÂ   rÃ   rG   s    r#   rÅ   zGroupResult.__str__ù  rÆ   r"   c                 ó,   — t        | j                  «      S rÈ   rÉ   rG   s    r#   rË   zGroupResult.__hash__ý  rÌ   r"   c                 óÄ   — | j                   | j                  xr | j                  j                  «       f| j                  D �cg c]  }|j                  «       ‘Œ c}fS c c}w r   )r<   r4   rW   r\   )rB   r+  s     r#   rW   zGroupResult.as_tuple  sI   € à�W‰W�d—k‘kÒ< d§k¡k×&:Ñ&:Ó&<Ð=Ø#'§<¡<Ö0˜aˆQ�Z‰Z�\Ò0ð
ð 	
ùâ0s   ÁAc                 ó   — | j                   S r   r*  rG   s    r#   r–   zGroupResult.children  s   € à�|‰|Ðr"   c                 ó¤   — |xs, t        | j                  t        «      s| j                  nt        }|xs |j                  }|j                  |«      S )z&Restore previously saved group result.)rÓ   r;   r  r   r=   Úrestore_group)Úclsr<   r=   r;   s       r#   ÚrestorezGroupResult.restore  sH   € ð ò 
Ü% c§g¡g¬xÔ8ˆC�GŠG¼kð 	ð Ò(˜SŸ[™[ˆØ×$Ñ$ RÓ(Ð(r"   )NNNr   r{  )r0   r1   r2   r3   r<   r\   rD   r  rƒ  r†  rÞ   rÝ   r‹  Ú__nonzero__r×   rÑ   rÅ   rË   rW   r  r–   r  r–  Ú__classcell__)rÙ   s   @r#   r   r   µ  s�   ø„ ñð 
€Bð €Gõ,ô
óGó<ò6ò%ò-à€Kò	ò_òòò
ð ñó ðð ò)ó ô)r"   r   c                   ó´   — e Zd ZdZdd„Zdd„Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
	 	 dd
„ZeZd„ Zd„ Zd„ Zed„ «       Zed„ «       Zed„ «       ZeZed„ «       Zed„ «       Zy)r   z.Result that we know has already been executed.Nc                 óŠ   — || _         || _        || _        || _        || _        t        «       | _        | j                  | «       y r   )r<   Ú_resultÚ_stateÚ
_tracebackÚ_namer
   r?   )rB   r<   Ú	ret_valuer�   r¬   rþ   s         r#   rD   zEagerResult.__init__  s<   € ð ˆŒØ ˆŒØˆŒØ#ˆŒØˆŒ
Ü›	ˆŒØ�‰�dÕr"   c                 ó:   — | j                   j                  ||«      S r   rV  rN   s       r#   rM   zEagerResult.then$  rW  r"   c                 ó   — | j                   S r   )r@   rG   s    r#   r­   zEagerResult._get_task_meta'  s   € Ø�{‰{Ðr"   c                 ó:   — | j                   | j                  «       fS r   rÜ   rG   s    r#   rÞ   zEagerResult.__reduce__*  rß   r"   c                 ót   — | j                   | j                  | j                  | j                  | j                  fS r   ©r<   r›  rœ  r�  rž  rG   s    r#   rÝ   zEagerResult.__reduce_args__-  s,   € Ø—‘˜Ÿ™ t§{¡{°D·O±OØ—
‘
ðð 	r"   c                 ó2   — | j                  «       \  }} ||Ž S r   )rÞ   )rB   r•  r©   s      r#   rÚ   zEagerResult.__copy__1  s   € Ø—O‘OÓ%‰	ˆˆTÙ�DˆzÐr"   c                  ó   — yr-   r!   rG   s    r#   r•   zEagerResult.ready5  s   € Ør"   c                 ó  — |r
t        «        | j                  «       r| j                  S | j                  t        j
                  v rI|r;t        | j                  t        «      r| j                  ‚t        | j                  «      ‚| j                  S y r   )r$   r¡   rU   r�   r   ry   rÓ   Ú	Exception)rB   re   rq   rw   r‰   s        r#   r{   zEagerResult.get8  sr   € á Ü!Ô#à�?‰?ÔØ—;‘;ÐØ�Z‰Zœ6×2Ñ2Ñ2ÙÜ%/Ø—K‘K¤ô&,�d—k‘kð HÜ1:¸4¿;¹;Ó1GðHà—;‘;Ðð	 3r"   c                  ó   — y r   r!   rG   s    r#   r^   zEagerResult.forgetF  s   € Ør"   c                 ó\   — t         j                  | _        t        d«      | _        d| _        y)a^  Mark the result as revoked.

        An eager task has already finished by the time its result exists,
        so nothing is cancelled.  The state is set to ``REVOKED`` and the
        task's return value or exception is intentionally replaced by a
        :exc:`~celery.exceptions.TaskRevokedError`, which is what the result
        backend stores for a task revoked on a worker.  :meth:`get` then
        raises that error, and :attr:`result` and ``get(propagate=False)``
        return it.

        Note:
            This differs from revoking an already finished task through a
            result backend, where the stored result is left untouched.
            The original return value or exception is no longer available
            from this instance afterwards.

        .. versionchanged:: 5.7.0

            The previous result is replaced by a
            :exc:`~celery.exceptions.TaskRevokedError` and the traceback is
            cleared.  Before, the state changed to ``REVOKED`` but the
            return value was kept, so :meth:`get` raised it wrapped in a
            bare :exc:`Exception`.
        ÚrevokedN)r   ÚREVOKEDrœ  r   r›  r�  r¨   s      r#   rg   zEagerResult.revokeI  s$   € ô2 —n‘nˆŒô (¨	Ó2ˆŒØˆ�r"   c                 ó"   — d| j                   › d�S )Nz<EagerResult: rÐ   rú   rG   s    r#   rÑ   zEagerResult.__repr__h  s   € Ø §¡˜y¨Ð*Ð*r"   c                 óv   — | j                   | j                  | j                  | j                  | j                  dœS )N)rû   rU   r«   r¬   rþ   r¤  rG   s    r#   r@   zEagerResult._cachek  s1   € ð —w‘wØ—l‘lØ—k‘kØŸ™Ø—J‘Jñ
ð 	
r"   c                 ó   — | j                   S )zThe tasks return value.)r›  rG   s    r#   rU   zEagerResult.resultu  s   € ð �|‰|Ðr"   c                 ó   — | j                   S )zThe tasks state.)rœ  rG   s    r#   r�   zEagerResult.statez  s   € ð �{‰{Ðr"   c                 ó   — | j                   S )z!The traceback if the task failed.)r�  rG   s    r#   r¬   zEagerResult.traceback€  s   € ð �‰Ðr"   c                  ó   — yr&   r!   rG   s    r#   rå   z EagerResult.supports_native_join…  s   € àr"   r{  r&   )NTT)r0   r1   r2   r3   rD   rM   r­   rÞ   rÝ   rÚ   r•   r{   rh   r^   rg   rÑ   r  r@   rU   r�   r«   r¬   rå   r!   r"   r#   r   r     s´   „ á8ó	ó6òò6òòòð +/Ø"&óð €Dòòò>+ð ñ
ó ð
ð ñó ðð ñó ðð €Fàñó ðð ñó ñr"   r   c           
      ó2  — t        |«      }|j                  }t        | t        «      sj| \  }}t        |t        t
        f«      r|n|df\  }}|rt        ||«      }|�,|j                  ||D �cg c]  }t        ||«      ‘Œ c}|¬«      S  |||¬«      S | S c c}w )zDeserialize result from tuple.Nrƒ   )r   r   rÓ   r   r~   Útupler   r   )r+  r;   ÚResultri  Únodesr<   r4   r’   s           r#   r   r   Š  s¦   € ô ˜Ó
€CØ�_‰_€FÜ�aœÔ$Ø‰
ˆˆUÜ& s¬T´5¨MÔ:‘SÀÀdÀ‰
ˆˆFÙÜ& v¨sÓ3ˆFàÐØ—?‘?ØÀÖF°uÔ& u¨cÕ2ÒFØð #ó ð ñ
 �b Ô(Ð(Ø€Hùò Gs   Á,B
r   )0r3   r  rP  r  Úcollectionsr   Ú
contextlibr   Úweakrefr   Údateutil.parserr   Úkombu.utils.objectsr   Úviner   r	   r
   Ú r   r   rœ  r   r   r;   r   Ú
exceptionsr   r   r   r   Úutils.graphr   r   r²   ÚImportErrorÚ__all__r    r$   r*   r.   r   Úregisterr   r   r   r   r   r!   r"   r#   ú<module>rÃ     s8  ðÙ 9ã Û Û Ý Ý %Ý å $Ý /ß +Ñ +ç !ß CÝ ß ^Ó ^ß 8ðÛð€ð
€ò)ð
 ñ/ó ð/ð ñ/ó ð/÷ñ ð 
×Ñô{2�*ó {2ó ð{2ð| 
×ÑômI�
ó mIó ðmIð` 
×Ñô\)�)ó \)ó ð\)ð~ 
×Ñôq�+ó qó ðqôhøði# ò Ø‚Eðús   Á"C4 Ã4C>Ã=C>