+
    '(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   "B/home/ubuntu/cf-venv/lib/python3.14/site-packages/pyee/executor.py__annotate__!ExecutorEventEmitter.__annotate__1   s'     2 2t 2x'9 2T 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/1DNr   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Ho 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   	_callback1ExecutorEventEmitter._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B4B6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   