+
    ÁFñj¿  ã                   óÂ   € R t ^ RIHtHt ^ RIHt ^ RIHt ^ RIH	t	H
t
HtHt ^ RIHt ]	'       d   ^ RIHt ]! RRR	7      t ! R
 R]R,          ]4      t ! R R]4      tR# )z-This module contains the BaseProcessor class.)ÚABCÚabstractmethod)ÚAbstractAsyncContextManager)ÚTracebackType)ÚTYPE_CHECKINGÚAnyÚTypeVarÚfinal)ÚTrackedBoundedSemaphore)Ú	AwaitableÚ_BUPTÚBaseUpdateProcessor)Úboundc                   ó  a € ] tR t^"t o RtRtV 3R lR ltV 3R lR ltV 3R lR lt]	V 3R lR	 l4       t
]	V 3R
 lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       tRtV tR# )r   aL  An abstract base class for update processors. You can use this class to implement
your own update processor.

Instances of this class can be used as asyncio context managers, where

.. code:: python

    async with processor:
        # code

is roughly equivalent to

.. code:: python

    try:
        await processor.initialize()
        # code
    finally:
        await processor.shutdown()

.. seealso:: :meth:`__aenter__` and :meth:`__aexit__`.

.. seealso:: :wiki:`Concurrency`

.. versionadded:: 20.4

Args:
    max_concurrent_updates (:obj:`int`): The maximum number of updates to be processed
        concurrently. If this number is exceeded, new updates will be queued until the number
        of currently processed updates decreases.

Raises:
    :exc:`ValueError`: If :paramref:`max_concurrent_updates` is a non-positive integer.
c                ó    <€ V ^8„  d   QhRS[ /# )é   Úmax_concurrent_updates©Úint)ÚformatÚ__classdict__s   "€ÚW/opt/hermes-site/venv/lib/python3.14/site-packages/telegram/ext/_baseupdateprocessor.pyÚ__annotate__Ú BaseUpdateProcessor.__annotate__H   s   ø€ ÷ Oñ O©sñ Oó    c                ó~   € Wn         V P                  ^8  d   \        R4      h\        V P                  4      V n        R# )é   z4`max_concurrent_updates` must be a positive integer!N)Ú_max_concurrent_updatesr   Ú
ValueErrorr
   Ú
_semaphore)Úselfr   s   &&r   Ú__init__ÚBaseUpdateProcessor.__init__H   s4   € Ø'=Ô$Ø×&Ñ&¨Ô*ÜÐSÓTÐTÜ1°$×2MÑ2MÓNˆŽr   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# )r   r    Úreturn)r   )r   r   s   "€r   r   r   N   s   ø€ ÷ ñ ™uð ©ñ r   c              ƒ  ó–   "  €  V P                  4       G Rj  x€L
  V #  L  \         d    T P                  4       G Rj  x€L 
  h i ; i5i)zû|async_context_manager| :meth:`initializes <initialize>` the Processor.

Returns:
    The initialized Processor instance.

Raises:
    :exc:`Exception`: If an exception is raised during initialization, :meth:`shutdown`
        is called in this case.
N)Ú
initializeÚ	ExceptionÚshutdown©r    s   &r   Ú
__aenter__ÚBaseUpdateProcessor.__aenter__N   sF   é € ð	Ø—/‘/Ó#×#Ð#ð ˆñ	 $øÜô 	Ø—-‘-“/×!Ñ!Øð	üs/   ‚A	„  —˜  œA	ž   A¾A¿AÁA	c                ój   <€ V ^8„  d   QhRS[ S[,          R,          RS[R,          RS[R,          RR/# )r   Úexc_typeNÚexc_valÚexc_tbr$   )ÚtypeÚBaseExceptionr   )r   r   s   "€r   r   r   _   sG   ø€ ÷ ñ á‘}Õ%¨Õ,ðñ  Õ%ðñ  Õ$ð	ð
 
ñr   c              ƒ  óB   "  € V P                  4       G Rj  x€L
  R#  L5i)zD|async_context_manager| :meth:`shuts down <shutdown>` the Processor.N)r(   )r    r-   r.   r/   s   &&&&r   Ú	__aexit__ÚBaseUpdateProcessor.__aexit___   s   é € ð �m‰m‹o×Ôùs   ‚–—c                ó    <€ V ^8„  d   QhRS[ /# ©r   r$   r   )r   r   s   "€r   r   r   i   s   ø€ ÷ ,ñ ,©ñ ,r   c                ó   € V P                   # )zM:obj:`int`: The maximum number of updates that can be processed concurrently.)r   r)   s   &r   r   Ú*BaseUpdateProcessor.max_concurrent_updatesh   s   € ð ×+Ñ+Ð+r   c                ó    <€ V ^8„  d   QhRS[ /# r6   r   )r   r   s   "€r   r   r   n   s   ø€ ÷ 	Kñ 	K©Cñ 	Kr   c                óP   € V P                   V P                  P                  ,
          # )zß:obj:`int`: The number of updates currently being processed.

Caution:
    This value is a snapshot of the current number of updates being processed. It may
    change immediately after being read.

.. versionadded:: 21.11
)r   r   Úcurrent_valuer)   s   &r   Úcurrent_concurrent_updatesÚ.BaseUpdateProcessor.current_concurrent_updatesm   s   € ð ×*Ñ*¨T¯_©_×-JÑ-JÕJÐJr   c                ó(   <€ V ^8„  d   QhRS[ RRRR/# ©r   ÚupdateÚ	coroutinezAwaitable[Any]r$   N©Úobject)r   r   s   "€r   r   r   z   s)   ø€ ÷ ñ áðð $ðð 
ñ	r   c              ƒ  ó   "  € R# 5i)af  Custom implementation of how to process an update. Must be implemented by a subclass.

Warning:
    This method will be called by :meth:`process_update`. It should *not* be called
    manually.

Args:
    update (:obj:`object`): The update to be processed.
    coroutine (:term:`Awaitable`): The coroutine that will be awaited to process the
        update.
N© ©r    r@   rA   s   &&&r   Údo_process_updateÚ%BaseUpdateProcessor.do_process_updatey   ó   é ‚ ùó   ‚c                ó   <€ V ^8„  d   QhRR/# ©r   r$   NrE   )r   r   s   "€r   r   r   Œ   s   ø€ ÷ ñ  $ñ r   c              ƒ  ó   "  € R# 5i)zInitializes the processor so resources can be allocated. Must be implemented by a
subclass.

.. seealso::
    :meth:`shutdown`
NrE   r)   s   &r   r&   ÚBaseUpdateProcessor.initialize‹   rI   rJ   c                ó   <€ V ^8„  d   QhRR/# rL   rE   )r   r   s   "€r   r   r   •   s   ø€ ÷ ñ  ñ r   c              ƒ  ó   "  € R# 5i)zzShutdown the processor so resources can be freed. Must be implemented by a subclass.

.. seealso::
    :meth:`initialize`
NrE   r)   s   &r   r(   ÚBaseUpdateProcessor.shutdown”   rI   rJ   c                ó(   <€ V ^8„  d   QhRS[ RRRR/# r?   rB   )r   r   s   "€r   r   r   �   s)   ø€ ÷ <ñ <áð<ð $ð<ð 
ñ	<r   c              ƒ  óà   "  € V P                   ;_uu_4       GRj  x€L
  V P                  W4      G Rj  x€L
  RRR4      GRj  x€L
  R#  L/ L L
  + GRj  x€L 
 '       g   i     R# ; i5i)a   Calls :meth:`do_process_update` with a semaphore to limit the number of concurrent
updates.

Args:
    update (:obj:`object`): The update to be processed.
    coroutine (:term:`Awaitable`): The coroutine that will be awaited to process the
        update.
N)r   rG   rF   s   &&&r   Úprocess_updateÚ"BaseUpdateProcessor.process_updateœ   s=   é € ð —?—?—?“?Ø×(Ñ(¨Ó;×;Ð;÷ #—?“?Ù;÷ #—?—?“?üsY   ‚A.›AœA.ŸA´AµA¹A.ÁAÁA.ÁAÁA.ÁA+	ÁAÁ
A+	Á#A+	Á%	A.)r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__r!   r*   r3   Úpropertyr   r<   r   rG   r&   r(   r	   rT   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r   "   s¬   ø‡ € ñ!ðF :€I÷Oð O÷ð ÷"ð ð ÷,ó ð,ð ÷	Kó ð	Kð ÷ó ðð" ÷ó ðð ÷ó ðð ÷<ó ö<r   c                   ó^   a € ] tR t^®t o RtRtV 3R lR ltV 3R lR ltV 3R lR ltRt	V t
R	# )
ÚSimpleUpdateProcessora  Instance of :class:`telegram.ext.BaseUpdateProcessor` that immediately awaits the
coroutine, i.e. does not apply any additional processing. This is used by default when
:attr:`telegram.ext.ApplicationBuilder.concurrent_updates` is :obj:`int`.

.. versionadded:: 20.4
c                ó(   <€ V ^8„  d   QhRS[ RRRR/# r?   rB   )r   r   s   "€r   r   Ú"SimpleUpdateProcessor.__annotate__¸   s)   ø€ ÷ ñ áðð $ðð 
ñ	r   c              ƒ  ó&   "  € VG Rj  x€L
  R#  L5i)zõImmediately awaits the coroutine, i.e. does not apply any additional processing.

Args:
    update (:obj:`object`): The update to be processed.
    coroutine (:term:`Awaitable`): The coroutine that will be awaited to process the
        update.
NrE   rF   s   &&&r   rG   Ú'SimpleUpdateProcessor.do_process_update¸   s   é € ð �Œùs   ‚ˆ‰c                ó   <€ V ^8„  d   QhRR/# rL   rE   )r   r   s   "€r   r   rc   Æ   s   ø€ ÷ ñ  $ñ r   c              ƒ  ó   "  € R# 5i©zDoes nothing.NrE   r)   s   &r   r&   Ú SimpleUpdateProcessor.initializeÆ   rI   rJ   c                ó   <€ V ^8„  d   QhRR/# rL   rE   )r   r   s   "€r   r   rc   É   s   ø€ ÷ ñ  ñ r   c              ƒ  ó   "  € R# 5irh   rE   r)   s   &r   r(   ÚSimpleUpdateProcessor.shutdownÉ   rI   rJ   rE   N)rV   rW   rX   rY   rZ   r[   rG   r&   r(   r]   r^   r_   s   @r   ra   ra   ®   s/   ø‡ € ñð €I÷ð ÷ð ÷ö r   ra   N)rZ   Úabcr   r   Ú
contextlibr   Útypesr   Útypingr   r   r   r	   Útelegram.ext._utils.asyncior
   Úcollections.abcr   r   r   ra   rE   r   r   Ú<module>rs      sT   ðñ& 4ç #Ý 2Ý ß 5Ó 5å ?çÝ)á�Ð4Ô5€ôI<Ð5Ð6KÕLÈcô I<ôXÐ/ö r   