+
    8Li.                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 ^ RIHtHtHtHtHtHt ]P$                  R8  d
   ^ RIHtHt M^ RIHtHt ^ RIHtHt ]P2                  ! ]4      t]P8                  ]P:                  ]P<                  uttt]P@                  t!]PD                  R8X  d   ^ RI#t#^ R	I$H%t% ]PL                  t! ! R
 R]PN                  ]PP                  4      t' ! R R]4      t)R# )zBEvent loop implementation that uses the `asyncio` standard module.)annotationsN)deque)Signals)AnyCallableDequeListOptionalcast)Finaloverride)BaseEventLoopTTransportTypent)
PipeHandlec                      ] tR t^%tRtR t]R 4       t]R R l4       t]R R l4       t	]R R	 l4       t
]R
 4       t]R R l4       tRtR# )Protocolz<The protocol class used for asyncio-based RPC communication.c                6    Vf   Q hVf   Q hWn         W n        R# )zInitialize the Protocol object.N)_on_data	_on_error)selfon_dataon_errors   &&&G/usr/lib/python3/dist-packages/pynvim/msgpack_rpc/event_loop/asyncio.py__init__Protocol.__init__(   s$    """###!    c                    Wn         R# )z=Used to signal `asyncio.Protocol` of a successful connection.N)
_transport)r   	transports   &&r   connection_madeProtocol.connection_made/   s	     $r   c                    V ^8  d   QhRRRR/# )   excOptional[Exception]returnNone )formats   "r   __annotate__Protocol.__annotate__5   s     D D#6 D4 Dr   c                \     T P                  V'       d	   V4       R# \        R4      4       R# )z7Used to signal `asyncio.Protocol` of a lost connection.connection_lostN)r   EOFError)r   r$   s   &&r   r-   Protocol.connection_lost4   s"     	 	csCx0A'BCr   c                    V ^8  d   QhRRRR/# r#   databytesr&   r'   r(   )r)   s   "r   r*   r+   =   s      % D r   c                (    V P                  V4       R# )z3Used to signal `asyncio.Protocol` of incoming data.N)r   r   r2   s   &&r   data_receivedProtocol.data_received<   s     	dr   c               $    V ^8  d   QhRRRRRR/# )r#   fdintr$   r%   r&   r'   r(   )r)   s   "r   r*   r+   B   s"     
 
s 
1D 
 
r   c                    \        V P                  \        P                  4      '       g   Q hRVRVRV P                  P	                  4       /p \
        P                  R8X  d   V^8X  d   R# R# R# )zAUsed to signal `asyncio.SubprocessProtocol` of a lost connection.r9   r$   pidr   N)
isinstancer   asyncioSubprocessTransportget_pidosname)r   r9   r$   
debug_infos   &&& r   pipe_connection_lostProtocol.pipe_connection_lostA   s`     $//7+F+FGGGGBsE4??3J3J3LM
 77d?rQw  '?r   c                L    V^8X  d   R# V^8X  d   V P                  V4       R# R# )z=Used to signal `asyncio.SubprocessProtocol` of incoming data.N)r6   )r   r9   r2   s   &&&r   pipe_data_receivedProtocol.pipe_data_receivedS   s(     71Wt$ r   c                   V ^8  d   QhRR/# r#   r&   r'   r(   )r)   s   "r   r*   r+   ^   s     	 	 	r   c                   \        V P                  \        P                  4      '       g   Q hV P                  P	                  4       pV P                  P                  4       p \        RV RV 24      pV P                  V4       R# )zAUsed to signal `asyncio.SubprocessProtocol` when the child exits.zprocess_exited: pid = z, return_code = N)r=   r   r>   r?   r@   get_returncoder.   r   )r   r<   return_codeerrs   &   r   process_exitedProtocol.process_exited]   sm     $//7+F+FGGGGoo%%'oo446/u4D[MRSsr   )r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   r    r-   r6   rD   rG   rO   __static_attributes__r(   r   r   r   r   %   s    F" $ $ D D   
 
" % % 	 	r   r   c                    a a ] tR t^jt0 o$ RtR]R&   R]R&   R]R&   R]R	&   ]P                  R
8w  d   R]R&   R V 3R llt]	R R l4       t
]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R l4       t]	R R  l4       t]	R! R" l4       t]	R# R$ l4       t]	R% R& l4       tR'tV ;t# )(AsyncioEventLoopz?`BaseEventLoop` subclass that uses core `asyncio` as a backend.zOptional[Protocol]	_protocolz Optional[asyncio.WriteTransport]r   List[Signals]_signalszDeque[bytes]_data_bufferr   z&Optional[asyncio.AbstractChildWatcher]_child_watcherc               $    V ^8  d   QhRRRRRR/# )r#   transport_typer   argsr   kwargsr(   )r)   s   "r   r*   AsyncioEventLoop.__annotate__t   s$     : :!/::'*:r   c                   <a a \        4       S n        \        4       S n        R V 3R lloVV 3R lS n        RS n        RS n        . S n        RS n        \        SS `(  ! V.VO5/ VB  R# )z<asyncio-specific initialization. see BaseEventLoop.__init__.c                    V ^8  d   QhRRRR/# r1   r(   )r)   s   "r   r*   /AsyncioEventLoop.__init__.<locals>.__annotate__   s     	  	 5 	 T 	 r   c                   < SP                   f   SP                  P                  V 4       R # SP                  V 4       R # N)r   r\   append)r2   r   s   &r   r   +AsyncioEventLoop.__init__.<locals>._on_data   s0    }}$!!((.MM$r   c                 2   < \        S SP                  R 7      # ))r   r   )r   r   )r   r   s   r   <lambda>+AsyncioEventLoop.__init__.<locals>.<lambda>   s    ^^*
r   N)loop_cls_loopr   r\   _protocol_factoryrY   r   	_to_closer]   superr   )r   r_   r`   ra   r   	__class__s   f&*,@r   r   AsyncioEventLoop.__init__t   sg     8@z
 "G	  	 "
  68"9$9&9r   c               $    V ^8  d   QhRRRRRR/# )r#   addressstrportr:   r&   r'   r(   )r)   s   "r   r*   rb      s!     	5 	5C 	5s 	5t 	5r   c                	\   a aa VVV 3R  lpS P                   P                  V! 4       4       R# )c                    <"   SP                   P                  SP                  SS4      G R j  xL
 w  r V Sn        VSn        R #  L5irg   )rn   create_connectionro   r   rY   )r   protocolru   rw   r   s     r   connect_tcp2AsyncioEventLoop._connect_tcp.<locals>.connect_tcp   sE     (,

(D(D&&)7 #7I'DO%DN#7s   +AAANrn   run_until_complete)r   ru   rw   r|   s   fff r   _connect_tcpAsyncioEventLoop._connect_tcp   s    	& 	

%%km4r   c                    V ^8  d   QhRRRR/# )r#   pathrv   r&   r'   r(   )r)   s   "r   r*   rb      s     8 8C 8D 8r   c                	X   a a VV 3R  lpS P                   P                  V! 4       4       R# )c                    <"   \         P                  R 8X  d   SP                  P                  p MSP                  P                  p V ! SP
                  S4      G Rj  xL
 w  r VSn        VSn        R#  L5ir   N)rA   rB   rn   create_pipe_connectioncreate_unix_connectionro   r   rY   )_create_connectionr   r{   r   r   s      r   connect_socket8AsyncioEventLoop._connect_socket.<locals>.connect_socket   sd     ww$%)ZZ%F%F"%)ZZ%F%F"(:&&). #.I'DO%DN#.s   AA6A4A6Nr~   )r   r   r   s   ff r   _connect_socket AsyncioEventLoop._connect_socket   s    	& 	

%%n&67r   c                   V ^8  d   QhRR/# rJ   r(   )r)   s   "r   r*   rb      s     8 8 8r   c                	  a a V 3R  lpS P                   P                  V! 4       4       \        P                  ! \        P
                  P                  4       4      o\        P                  ! \        P                  P                  4       \        P
                  P                  4       4       VV 3R lpS P                   P                  V! 4       4       R# )c                 p  <"   \         P                  R 8X  d=   \        \        P                  ! \
        P                  P                  4       4      4      p M\
        P                  p SP                  P                  SP                  V 4      G Rj  xL
 w  r SP                  P                  V4       ?R#  L%5ir   )rA   rB   r   msvcrtget_osfhandlesysstdinfilenorn   connect_read_pipero   rp   rh   )piper   r{   r   s      r   connect_stdin6AsyncioEventLoop._connect_stdio.<locals>.connect_stdin   s     ww$!&"6"6syy7G7G7I"JKyy(,

(D(D&&). #.INN!!),#.s   BB6B4&B6c                 *  <"   \         P                  R 8X  d!   \        \        P                  ! S4      4      p M\         P
                  ! SR4      p SP                  P                  SP                  V 4      G Rj  xL
 w  r VSn	        VSn
        R#  L5i)r   wbN)rA   rB   r   r   r   fdopenrn   connect_write_pipero   r   rY   )r   r   r{   rename_stdoutr   s      r   connect_stdout7AsyncioEventLoop._connect_stdio.<locals>.connect_stdout   ss     ww$!&"6"6}"EFyy5(,

(E(E&&). #.I'DO%DN#.s   A6B9B:BN)	rn   r   rA   dupr   stdoutr   dup2stderr)r   r   r   r   s   f  @r   _connect_stdioAsyncioEventLoop._connect_stdio   s    
	 	

%%mo6 szz0023


!!#SZZ%6%6%89	& 	

%%n&67r   c                    V ^8  d   QhRRRR/# )r#   argvz	List[str]r&   r'   r(   )r)   s   "r   r*   rb      s     (; (;9 (; (;r   c                	   a a R  p\         P                  R8w  d.   V! 4       pVe#   VP                  S P                  4       VS n        VV 3R lpS P                  P                  V! 4       4       R# )c                 R     \         P                  ! 4       #   \         d     R # i ; irg   )r>   get_child_watcherAttributeErrorr(   r   r   r   :AsyncioEventLoop._connect_child.<locals>.get_child_watcher   s(    0022! s    &&r   Nc                 |  <"   SP                   P                  ! SP                  .SO5!  G R j  xL
 w  rV P                  4       p \	        \
        P                  V P                  ^ 4      4      Sn        VSn	        V3R lpV! V P                  ^4      4       V! V P                  ^4      4       V! V 4       R #  L5i)Nc                J   < V e   SP                   P                  V 4       R # R # rg   )rp   rh   )r   r   s   &r   _close_laterPAsyncioEventLoop._connect_child.<locals>.create_subprocess.<locals>._close_later   s     (NN)))4 )r   )
rn   subprocess_execro   r@   r
   r>   WriteTransportget_pipe_transportr   rY   )r   r{   r<   r   r   r   s       r   create_subprocess:AsyncioEventLoop._connect_child.<locals>.create_subprocess   s     (,

(B(B&&)/)-)/ #/I##%C #7#9#9#,#?#?#BDDO%DN5 55a8955a89#%#/s   ,B<B:BB<)rA   rB   attach_looprn   r]   r   )r   r   r   watcherr   s   ff   r   _connect_childAsyncioEventLoop._connect_child   sZ    	 77d?')G"##DJJ/&-#	$0 	

%%&7&9:r   c                   V ^8  d   QhRR/# rJ   r(   )r)   s   "r   r*   rb      s       r   c                	    R # rg   r(   r   s   &r   _start_readingAsyncioEventLoop._start_reading   s    r   c                    V ^8  d   QhRRRR/# r1   r(   )r)   s   "r   r*   rb     s     $ $% $D $r   c                	n    V P                   '       g   Q R 4       hV P                   P                  V4       R# )z$connection has not been established.N)r   writer5   s   &&r   _sendAsyncioEventLoop._send  s(    F FFd#r   c                   V ^8  d   QhRR/# rJ   r(   )r)   s   "r   r*   rb     s     ! !d !r   c                	    V P                   '       d>   V P                   P                  4       pV P                  f   K<  V P                  V4       KO  V P                  P	                  4        R # rg   )r\   popleftr   rn   run_foreverr5   s   & r   _runAsyncioEventLoop._run  sJ     ++335D}}(d#

 r   c                   V ^8  d   QhRR/# rJ   r(   )r)   s   "r   r*   rb     s      t r   c                	:    V P                   P                  4        R # rg   )rn   stopr   s   &r   _stopAsyncioEventLoop._stop  s    

r   c                   V ^8  d   QhRR/# rJ   r(   )r)   s   "r   r*   rb     s     ' ' 'r   c                	T  a  V 3R  lpS P                   '       d   V! S P                   4       RS n         S P                   F  pV! V4       K  	  . S P                  R&   S P                  P                  4        S P                  e$   S P                  P                  4        RS n        R# R# )c                   <a  S P                  4        \        P                  R8  dT   \        P                  R8X  d=   \        S R4      '       d)   V 3R lpSP                  P                  V! 4       4       R# R# R# R# )   r   _sockc                 p   <"   S P                   e!   \        P                  ! R4      G R j  xL
  K.  R #  L5i)Ng{Gz?)r   r>   sleep)r   s   r   wait_until_closedLAsyncioEventLoop._close.<locals>._close_transport.<locals>.wait_until_closed   s*     #//5%mmD111 61s   (64	6N)r      )closer   version_inforA   rB   hasattrrn   r   )r   r   r   s   f r   _close_transport1AsyncioEventLoop._close.<locals>._close_transport  s^    OO
   7*GGtO	7(C(C2 

--.?.AB )DO +r   N:NNN)r   rp   rn   r   r]   )r   r   r   s   f  r   _closeAsyncioEventLoop._close  s    	C ???T__-"DOIY' (q

*%%'"&D +r   c                    V ^8  d   QhRRRR/# )r#   fnzCallable[[], Any]r&   r'   r(   )r)   s   "r   r*   rb   4  s     , ,#4 , ,r   c                	<    V P                   P                  V4       R # rg   )rn   call_soon_threadsafe)r   r   s   &&r   _threadsafe_call!AsyncioEventLoop._threadsafe_call3  s    

''+r   c                    V ^8  d   QhRRRR/# )r#   signalsrZ   r&   r'   r(   )r)   s   "r   r*   rb   8  s     K Km K Kr   c                	    \         P                  R 8X  d
   . V n        R# \        V4      V n        V P                   F)  pV P                  P                  W P                  V4       K+  	  R# r   )rA   rB   r[   listrn   add_signal_handler
_on_signal)r   r   signums   && r   _setup_signalsAsyncioEventLoop._setup_signals7  sH    77d?DMWmmFJJ))&//6J $r   c                   V ^8  d   QhRR/# rJ   r(   )r)   s   "r   r*   rb   C  s     5 54 5r   c                	b    V P                    F  pV P                  P                  V4       K   	  R # rg   )r[   rn   remove_signal_handler)r   r   s   & r   _teardown_signals"AsyncioEventLoop._teardown_signalsB  s"    mmFJJ,,V4 $r   )r]   r\   rn   rY   ro   r[   rp   r   )rQ   rR   rS   rT   rU   __annotations__rA   rB   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rV   __classcell__)rr   __conditional_annotations__s   @@r   rX   rX   j   s0    I!!00	ww$>>: :@ 	5 	5 8 8  8 8B (; (;T   $ $ ! !   ' '8 , , K K 5 5r   rX   )r      )*rU   
__future__r   r>   loggingrA   r   collectionsr   signalr   typingr   r   r   r   r	   r
   r   r   r   typing_extensions"pynvim.msgpack_rpc.event_loop.baser   r   	getLoggerrQ   loggerdebuginfowarningwarnSelectorEventLooprm   rB   r   asyncio.windows_utilsr   ProactorEventLoopr   SubprocessProtocolrX   r(   r   r   <module>r
     s    H "   	 
   = =w&&1 L			8	$\\6;; tT$$77d?0
 ((H
Bw!;!; BJ[5} [5r   