+
    ÃìÜjà	  ã                   ór   € ^ RI HtHtHt ^ RIHt ^ RIHtHtH	t	H
t
HtHt ^ RIHt ]tR.t ! R R]4      tR# )é    )ÚExecutorÚFutureÚThreadPoolExecutor)ÚTracebackType)ÚAnyÚCallableÚDictÚOptionalÚTupleÚType)ÚEventEmitterÚExecutorEventEmitterc                   ó’   a a€ ] tR t^t oRtRV3R lV 3R llltV3R lR ltRV3R lR lltV3R lR	 ltV3R
 lR lt	Rt
VtV ;t# )r   a»  An event emitter class which runs handlers in a `concurrent.futures`
executor.

By default, this class creates a default `ThreadPoolExecutor`, but
a custom executor may also be passed in explicitly to, for instance,
use a `ProcessPoolExecutor` instead.

This class runs all emitted events on the configured executor. Errors
captured by the resulting Future are automatically emitted on the
`error` event. This is unlike the EventEmitter, which have no error
handling.

The underlying executor may be shut down by calling the `shutdown`
method. Alternately you can treat the event emitter as a context manager:

```py
with ExecutorEventEmitter() as ee:
    # Underlying executor open

    @ee.on('data')
    def handler(data):
        print(data)

    ee.emit('event')

# Underlying executor closed
```

Since the function call is scheduled on an executor, emit is always
non-blocking.

No effort is made to ensure thread safety, beyond using an executor.
c                ó:   <€ V ^8„  d   QhRS[ RS[S[,          RR/# )é   ÚselfÚexecutorÚreturnN)ÚSelfr
   r   )ÚformatÚ__classdict__s   "€ÚK/opt/render/project/src/.venv/lib/python3.14/site-packages/pyee/executor.pyÚ__annotate__Ú!ExecutorEventEmitter.__annotate__1   s'   ø€ ÷ 2ñ 2‘tð 2¡x±Õ'9ð 2ÀTñ 2ó    c                ój   <€ \         \        V `  4        V'       d	   Wn        R # \	        4       V n        R # ©N)Úsuperr   Ú__init__Ú	_executorr   )r   r   Ú	__class__s   &&€r   r   ÚExecutorEventEmitter.__init__1   s#   ø€ ÜÔ" DÑ2Ô4ßØ'/ŽNä/Ó1ˆDŽNr   c          
      ó`   <€ V ^8„  d   QhRS[ RS[RS[S[R3,          RS[S[S[3,          RR/# )r   r   ÚfÚargs.Úkwargsr   N)r   r   r   r   r	   Ústr)r   r   s   "€r   r   r   8   sK   ø€ ÷ ñ Ùðáðñ ‘C˜�H�oðñ ‘S™#�X•ð	ð
 
ñr   c                óx   a € S P                   P                  ! V.VO5/ VB pVP                  R  V 3R ll4       pR# )c                ó(   € V ^8„  d   QhR\         RR/# )r   r$   r   N)r   )r   s   "r   r   Ú4ExecutorEventEmitter._emit_run.<locals>.__annotate__A   s   € ÷ 	ñ 	œð 	 Dñ 	r   c                 óˆ   <€ V P                  4       p\        V\        4      '       d   SP                  R V4       R# Ve   VhR# )ÚerrorN)Ú	exceptionÚ
isinstanceÚ	ExceptionÚemit)r$   Úexcr   s   & €r   Ú	_callbackÚ1ExecutorEventEmitter._emit_run.<locals>._callback@   s8   ø€ à+,¯;©;«=ˆCÜ˜#œy×)Ò)Ø—	‘	˜' 3Ö'Ø’Ø�	ñ !r   N)r    ÚsubmitÚadd_done_callback)r   r$   r%   r&   Úfuturer2   s   f&&&  r   Ú	_emit_runÚExecutorEventEmitter._emit_run8   s;   ø€ ð Ÿ™×.Ò.¨qÐB°4ÒB¸6ÑBˆà	×	!Ñ	!÷	ó 
"ò	r   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r   Úwaitr   N)r   Úbool)r   r   s   "€r   r   r   H   s"   ø€ ÷ +ñ +‘tð +¡4ð +°4ñ +r   c                ó>   € V P                   P                  VR7       R# )z)Call `shutdown` on the internal executor.)r:   N)r    Úshutdown)r   r:   s   &&r   r=   ÚExecutorEventEmitter.shutdownH   s   € ð 	�‰×Ñ TÐÖ*r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   r   r   r   )r   )r   r   s   "€r   r   r   M   s   ø€ ÷ ñ ™ð Ð!7ñ r   c                ó   € V # r   © )r   s   &r   Ú	__enter__ÚExecutorEventEmitter.__enter__M   s   € Øˆr   c                óX   <€ V ^8„  d   QhRS[ RS[S[,          RS[RS[RS[S[,          /# )r   r   ÚtypeÚvalueÚ	tracebackr   )r   r   r/   r   r
   r;   )r   r   s   "€r   r   r   P   s=   ø€ ÷ ñ ÙðÙ™y�/ðÙ2;ðÙHUðá	‘$�ñr   c                ó&   € V P                  4        R # r   )r=   )r   rE   rF   rG   s   &&&&r   Ú__exit__ÚExecutorEventEmitter.__exit__P   s   € ð 	�‰ŒÙr   )r    r   )T)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r7   r=   rB   rI   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r!   r   s   @@r   r   r      sB   ù‡ € ñ ÷D2õ 2÷ð ÷ +ò +÷
ð ÷÷ ð r   N)Úconcurrent.futuresr   r   r   Útypesr   Útypingr   r   r	   r
   r   r   Ú	pyee.baser   r   Ú__all__r   rA   r   r   Ú<module>rX      s5   ð÷ DÑ CÝ ß =× =å "à
€à!Ð
"€ôF˜<ö Fr   