+
    '(j                     ~    ^ RI Ht ^ RIHtHtHtHtHtHt ^ RI	H
t
Ht ^ RIHt ^ RIHtHt ]tR.t ! R R]4      tR# )	    )iscoroutine)AnyCallablecastDictOptionalTuple)DeferredensureDeferredFailure)EventEmitter	PyeeErrorTwistedEventEmitterc                   l   a a ] tR t^t oRtV3R lV 3R lltV3R lR ltV3R lV 3R lltRtVt	V ;t
# )	r   a@  An event emitter class which can run twisted coroutines and handle
returned Deferreds, in addition to synchronous blocking functions. For
example:

```py
@ee.on('event')
@inlineCallbacks
def async_handler(*args, **kwargs):
    yield returns_a_deferred()
```

or:

```py
@ee.on('event')
async def async_handler(*args, **kwargs):
    await returns_a_deferred()
```


When async handlers fail, Failures are first emitted on the `failure`
event. If there are no `failure` handlers, the Failure's associated
exception is then emitted on the `error` event. If there are no `error`
handlers, the exception is raised. For consistency, when handlers raise
errors synchronously, they're captured, wrapped in a Failure and treated
as an async failure. This is unlike the behavior of EventEmitter,
which have no special error handling.

For twisted coroutine event handlers, calling emit is non-blocking.
In other words, you do not have to await any results from emit, and the
coroutine is scheduled in a fire-and-forget fashion.

Similar behavior occurs for "sync" functions which return Deferreds.
c                $   < V ^8  d   QhRS[ RR/# )   selfreturnN)Self)format__classdict__s   "A/home/ubuntu/cf-venv/lib/python3.14/site-packages/pyee/twisted.py__annotate__ TwistedEventEmitter.__annotate__5   s     4 4t 4 4    c                ,   < \         \        V `  4        R # )N)superr   __init__)r   	__class__s   &r   r   TwistedEventEmitter.__init__5   s    !413r   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                *  a  R p V! V/ VB p\        V4      '       d   \        V4      pM#\        V\        4      '       d   TpM
V'       g   R # R V 3R llpVP	                  V4       R #   \
         d    S P                  R\        4       4        R # i ; i)Nc                (    V ^8  d   QhR\         RR/# )r   failurer   Nr   )r   s   "r   r   3TwistedEventEmitter._emit_run.<locals>.__annotate__K   s     2 2 2T 2r   c                 @   < V '       d   SP                  R V 4       R# R# )r)   N)emit)r)   r   s   &r   errback.TwistedEventEmitter._emit_run.<locals>.errbackK   s    IIi1 r   r)   )r   r   
isinstancer
   
addErrback	Exceptionr,   r   )r   r#   r$   r%   dresultr-   s   f&&&   r   	_emit_runTwistedEventEmitter._emit_run8   s     &*	"''F 6"""6*FH--2 2 LL!  	,IIi+	,s   A) )%BBc                0   < V ^8  d   QhRS[ RS[RS[RR/# )r   r   eventerrorr   N)r   r&   r   )r   r   s   "r   r   r   Q   s)      4  C D r   c                  < VR 8X  dt   \        V\        4      '       d    VP                  4        R# \        V\        4      '       d   V P	                  RV4       R# V P	                  R\        RV 24      4       R# \        \        \        \        V 4      4      P                  W4       R#   \         d   pT P	                  RT4        Rp?R# Rp?ii ; i)r)   r8   NzUnexpected failure object: )r/   r   raiseExceptionr1   r,   r   r   r   r   r   _emit_handle_potential_error)r   r7   r8   excr    s   &&& r   r;   0TwistedEventEmitter._emit_handle_potential_errorQ   s    I%)),((* E9--		'5)		'9/J5'-R#STe/67TT ! ,IIgs++,s   B+ +C6CC )__name__
__module____qualname____firstlineno____doc__r   r4   r;   __static_attributes____classdictcell____classcell__)r    r   s   @@r   r   r      s.     !F4 4" "2  r   N)asyncior   typingr   r   r   r   r   r	   twisted.internet.deferr
   r   twisted.python.failurer   	pyee.baser   r   r   __all__r   r>   r   r   <module>rM      s6      = = ; * -
 !
!N, Nr   