ó
    ­Qh=B  ã                   ó6  • S r SSKrSSKrSSKrSSKrSSKrSSKJrJrJ	r	J
r
JrJr  \" S5      rSrSr/ SQr " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rSqS\\   4S jrSS\R6                  S\4S jjrg)aI  Libvirt event loop implementation using asyncio

Register the implementation of default loop:

    import asyncio
    import libvirtaio

    async def myapp():
      libvirtaio.virEventRegisterAsyncIOImpl()

      conn = libvirt.open("test:///default")

For compatibility with Python < 3.7:

    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)

    loop.run_until_complete(myapp())

    asyncio.set_event_loop(None)
    loop.close()

If Python >= 3.7 can be required then

    asyncio.run(myapp())

.. seealso::
    https://libvirt.org/html/libvirt-libvirt-event.html
é    N)ÚAnyÚCallableÚDictÚ	GeneratorÚOptionalÚTypeVarÚ_Tz,Wojtek Porczyk <woju@invisiblethingslab.com>z	LGPL-2.1+)ÚgetCurrentImplÚvirEventAsyncIOImplÚvirEventRegisterAsyncIOImplc                   ó�   ^ • \ rS rSrSr\R                  " 5       rSSS\\	\
/S4   S\
S\S	\S
S4U 4S jjrS
\4S jrSS jrSrU =r$ )ÚCallbackéE   z¶Base class for holding callback

:param virEventAsyncIOImpl impl: the implementation in which we run
:param cb: the callback itself
:param opaque: the opaque tuple passed by libvirt
Úimplr   ÚcbNÚopaqueÚargsÚkwargsÚreturnc                 ó~   >• [         TU ]  " U0 UD6  [        U R                  5      U l        Xl        X l        X0l        g ©N)ÚsuperÚ__init__ÚnextÚ_iden_counterÚidenr   r   r   )Úselfr   r   r   r   r   Ú	__class__s         €Ú,/usr/lib/python3/dist-packages/libvirtaio.pyr   ÚCallback.__init__P   s6   ø€ Ü‰Ò˜$Ð) &Ò)Ü˜×+Ñ+Ó,ˆŒ	ØŒ	ØŒØ�ó    c                 ób   • SR                  U R                  R                  U R                  5      $ )Nz<{} iden={}>)Úformatr   Ú__name__r   ©r   s    r   Ú__repr__ÚCallback.__repr__W   s#   € Ø×$Ñ$ T§^¡^×%<Ñ%<¸d¿i¹iÓHÐHr!   c                 óÄ   • U R                   R                  R                  SU R                  5        U R                   R	                  U R                  U R
                  5        g)zSchedule *ff* callbackz"callback %d close(), scheduling ffN)r   ÚlogÚdebugr   Úschedule_ff_callbackr   r%   s    r   ÚcloseÚCallback.closeZ   s;   € à�	‰	�‰×ÑÐ@À$Ç)Á)ÔLØ�	‰	×&Ñ& t§y¡y°$·+±+Õ>r!   )r   r   r   r   ©r   N)r$   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	itertoolsÚcountr   r   Úintr	   r   r   Ústrr&   r,   Ú__static_attributes__Ú__classcell__©r   s   @r   r   r   E   ss   ø† ñð —O’OÓ%€MðÐ2ð ¸À#ÀrÀÈDÀÑ8Qð Ð[]ð Ðfið Ðuxð ð  ~B÷ ðI˜#ô I÷?ò ?r!   r   c                   óf   • \ rS rSrSrSSS\SS4S jrS	\SS4S
 jrSS jrSS jr	S\SS4S jr
Srg)Ú
Descriptoréd   z‡Manager of one file descriptor

:param virEventAsyncIOImpl impl: the implementation in which we run
:param int fd: the file descriptor
r   r   Úfdr   Nc                 ó*   • Xl         X l        0 U l        g r   )r   r=   Ú	callbacks)r   r   r=   s      r   r   ÚDescriptor.__init__j   s   € ØŒ	ØŒØˆ�r!   Úeventc                 ó  • [        U R                  R                  5       5       HY  nUR                  c  M  UR                  U-  (       d  M(  UR	                  UR
                  U R                  XR                  5        M[     g)zoDispatch the event to the descriptors

:param int event: The event (from libvirt's constants) being dispatched
N)Úlistr?   ÚvaluesrA   r   r   r=   r   )r   rA   Úcallbacks      r   Ú_handleÚDescriptor._handleo   sT   € ô
 ˜TŸ^™^×2Ñ2Ó4Ö5ˆHØ�~‰~Ó)¨h¯n©n¸u×.DÑ.DØ—‘˜HŸM™M¨4¯7©7°E¿?¹?ÖKò 6r!   c                 ó8  • [        S U R                  R                  5        5       5      (       a  [        R                  " S[
        5        [        S U R                  R                  5        5       5      (       aJ  U R                  R                  R                  U R                  U R                  [        R                  5        O/U R                  R                  R                  U R                  5        [        S U R                  R                  5        5       5      (       aJ  U R                  R                  R                  U R                  U R                  [        R                  5        gU R                  R                  R!                  U R                  5        g)zsRegister or unregister callbacks at event loop

This should be called after change of any ``.event`` in callbacks.
c              3   ó€   #   • U  H4  nUR                   [        R                  [        R                  -  ) -  v •  M6     g 7fr   )rA   ÚlibvirtÚVIR_EVENT_HANDLE_READABLEÚVIR_EVENT_HANDLE_WRITABLE©Ú.0rE   s     r   Ú	<genexpr>Ú$Descriptor.update.<locals>.<genexpr>ƒ   s@   é € ð 9ò !8�Hð �~‰~Ü×-Ñ-Ü×-Ñ-ñ.ð!/ö /ò !8ùs   ‚<>zTThe only event supported are VIR_EVENT_HANDLE_READABLE and VIR_EVENT_HANDLE_WRITABLEc              3   ó\   #   • U  H"  nUR                   [        R                  -  v •  M$     g 7fr   )rA   rJ   rK   rM   s     r   rO   rP   Œ   ó&   é € ð 9Ú 7�Hð �~‰~¤× AÑ AÖAÚ 7ùó   ‚*,c              3   ó\   #   • U  H"  nUR                   [        R                  -  v •  M$     g 7fr   )rA   rJ   rL   rM   s     r   rO   rP   “   rR   rS   N)Úanyr?   rD   ÚwarningsÚwarnÚUserWarningr   ÚloopÚ
add_readerr=   rF   rJ   rK   Úremove_readerÚ
add_writerrL   Úremove_writerr%   s    r   ÚupdateÚDescriptor.updatex   s#  € ô ñ 9ð !%§¡× 5Ñ 5Ô 7ó9÷ 9ñ 9ô �MŠMð0äôô
 ñ 9Ø $§¡× 5Ñ 5Ô 7ó9÷ 9ñ 9à�I‰I�N‰N×%Ñ%Ø—‘˜Ÿ™¤w×'HÑ'HõJð �I‰I�N‰N×(Ñ(¨¯©Ô1äñ 9Ø $§¡× 5Ñ 5Ô 7ó9÷ 9ñ 9à�I‰I�N‰N×%Ñ%Ø—‘˜Ÿ™¤w×'HÑ'HõJð �I‰I�N‰N×(Ñ(¨¯©Õ1r!   c                 óT   • XR                   UR                  '   U R                  5         g)z–Add a callback to the descriptor

:param FDCallback callback: the callback to add
:rtype: None

After adding the callback, it is immediately watched.
N)r?   r   r^   )r   rE   s     r   Ú
add_handleÚDescriptor.add_handleš   s   € ð )1�‰�x—}‘}Ñ%Ø�‰�r!   r   c                 ó\   • U R                   R                  U5      nU R                  5         U$ )zåRemove a callback from the descriptor

:param int iden: the identifier of the callback
:returns: the callback
:rtype: FDCallback

After removing the callback, the descriptor may be unwatched, if there
are no more handles for it.
)r?   Úpopr^   )r   r   rE   s      r   Úremove_handleÚDescriptor.remove_handle¥   s&   € ð —>‘>×%Ñ% dÓ+ˆØ�‰ŒØˆr!   )r?   r=   r   r.   )rE   Ú
FDCallbackr   N)r$   r/   r0   r1   r2   r5   r   rF   r^   ra   re   r7   © r!   r   r;   r;   d   sV   † ñð
Ð2ð ¸ð Àô ð
L˜Sð L Tô Lô 2ôD	ð #ð ¨$÷ r!   r;   c                   óB   ^ • \ rS rSrSrSU 4S jjrS\S\4S jrSr	U =r
$ )	ÚDescriptorDicté´   z\Descriptors collection

This is used internally by virEventAsyncIOImpl to hold descriptors.
r   c                 ó.   >• [         TU ]  5         Xl        g r   )r   r   r   )r   r   r   s     €r   r   ÚDescriptorDict.__init__¹   s   ø€ Ü‰ÑÔØ�	r!   r=   c                 ó:   • [        U R                  U5      nX U'   U$ r   )r;   r   )r   r=   Ú
descriptors      r   Ú__missing__ÚDescriptorDict.__missing__½   s   € Ü §	¡	¨2Ó.ˆ
ØˆR‰ØÐr!   )r   )r   r   r   N)r$   r/   r0   r1   r2   r   r5   r;   rp   r7   r8   r9   s   @r   rj   rj   ´   s%   ø† ñ÷ð˜cð  j÷ ò r!   rj   c            
       ód   ^ • \ rS rSrSrS\S\S\S\SS4
U 4S	 jjrS\	4S
 jr
S\SS4S jrSrU =r$ )rg   éÃ   zžCallback for file descriptor (watcher)

:param Descriptor descriptor: the descriptor manager
:param int event: bitset of events on which to fire the callback
r   ro   rA   r   r   Nc                ó>   >• [         TU ]  " U0 UD6  Xl        X l        g r   )r   r   ro   rA   )r   ro   rA   r   r   r   s        €r   r   ÚFDCallback.__init__Ë   s   ø€ Ü‰Ò˜$Ð) &Ò)Ø$ŒØ�
r!   c                 ó¢   • SR                  U R                  R                  U R                  U R                  R
                  U R                  5      $ )Nz<{} iden={} fd={} event={}>)r#   r   r$   r   ro   r=   rA   r%   s    r   r&   ÚFDCallback.__repr__Ð   s<   € Ø,×3Ñ3Ø�N‰N×#Ñ# T§Y¡Y°·±×0BÑ0BÀDÇJÁJóPð 	Pr!   c                 óD   • Xl         U R                  R                  5         g)z1Update the callback and fix descriptor's watchersN)rA   ro   r^   )r   rA   s     r   r^   ÚFDCallback.updateÔ   s   € àŒ
Ø�‰×ÑÕ r!   ©ro   rA   )r$   r/   r0   r1   r2   r   r;   r5   r   r6   r&   r^   r7   r8   r9   s   @r   rg   rg   Ã   sX   ø† ñð˜cð ¨zð À#ð ÐQTð ÐY]÷ ð
P˜#ô Pð!˜Cð ! D÷ !ò !r!   rg   c                   ó†   ^ • \ rS rSrSrS\S\SS4U 4S jjrS\4S jrS\	\SS4   4S	 jr
S
\SS4S jrSU 4S jjrSrU =r$ )ÚTimeoutCallbackéÞ   zCallback for timerr   r   r   Nc                 óB   >• [         TU ]  " U0 UD6  SU l        S U l        g )Néÿÿÿÿ)r   r   ÚtimeoutÚ_task)r   r   r   r   s      €r   r   ÚTimeoutCallback.__init__à   s#   ø€ Ü‰Ò˜$Ð) &Ò)ØˆŒØˆ�
r!   c                 óx   • SR                  U R                  R                  U R                  U R                  5      $ )Nz<{} iden={} timeout={}>)r#   r   r$   r   r€   r%   s    r   r&   ÚTimeoutCallback.__repr__å   s.   € Ø(×/Ñ/Ø�N‰N×#Ñ# T§Y¡Y°·±ó>ð 	>r!   c              ƒ   ó`  #   •   U R                   S:”  aT  U R                   S-  nU R                  R                  R                  SU5        [        R
                  " U5      I Sh  v•N   O[        R
                  " S5      I Sh  v•N    U R                  U R                  U R                  5        U R                  R                  R                  SU R                  5        MÜ   N| N_! [        R                   a3    U R                  R                  R                  SU R                  5         gf = f7f)zAAn actual timer running on the event loop.

This is a coroutine.
r   gü©ñÒMbP?zsleeping %rNztimer %d cancelledztimer %r callback ended)
r€   r   r)   r*   ÚasyncioÚsleepÚCancelledErrorr   r   r   ©r   r€   s     r   Ú_timerÚTimeoutCallback._timeré   sß   é € ð
 ðØ—<‘< !Ó#Ø"Ÿl™l¨TÑ1�GØ—I‘I—M‘M×'Ñ'¨°wÔ?Ü!Ÿ-š-¨Ó0×0Ñ0ô "Ÿ-š-¨Ó*×*Ñ*ð �G‰G�D—I‘I˜tŸ{™{Ô+Ø�I‰I�M‰M×ÑÐ 9¸4¿9¹9ÔEñ ñ
 1ñ +øä×)Ñ)ó Ø—	‘	—‘×#Ñ#Ð$8¸$¿)¹)ÔDÙðüs[   ‚D.…AC$ Á#C Á$C$ Á(D.Á)C$ ÂC"ÂC$ ÂAD.Ã C$ Ã"C$ Ã$AD+Ä(D.Ä*D+Ä+D.r€   c                 ó  • Xl         U R                   S:¼  az  U R                  cm  U R                  R                  R	                  SU R
                  5        [        R                  " U R                  5       U R                  R                  S9U l        gU R                   S:  a`  U R                  bR  U R                  R                  R	                  SU R
                  5        U R                  R                  5         SU l        ggg)z-Start or the timer, possibly updating timeoutr   Nztimer %r start©rY   ztimer %r stop)r€   r�   r   r)   r*   r   r†   Úensure_futurerŠ   rY   Úcancelr‰   s     r   r^   ÚTimeoutCallback.updateÿ   s±   € àŒà�<‰<˜1Ó §¡Ñ!3Ø�I‰I�M‰M×ÑÐ 0°$·)±)Ô<Ü ×.Ò.¨t¯{©{«}Ø48·I±I·N±NñDˆD�Jð �\‰\˜AÓ $§*¡*Ñ"8Ø�I‰I�M‰M×Ñ °·±Ô;Ø�J‰J×ÑÔØˆD�Jð #9Ðr!   c                 óH   >• U R                  SS9  [        [        U ]  5         g)z#Stop the timer and call ff callbackr   ©r€   N)r^   r   r|   r,   )r   r   s    €r   r,   ÚTimeoutCallback.close  s   ø€ à�‰˜BˆÑÜŒo˜tÑ*Õ,r!   )r�   r€   r.   )r$   r/   r0   r1   r2   r   r   r6   r&   r   rŠ   r5   r^   r,   r7   r8   r9   s   @r   r|   r|   Þ   sb   ø† Ùð˜cð ¨Sð °T÷ ð
>˜#ô >ðF˜i¨¨T°4¨Ñ8ô Fð,˜cð  dô ÷-õ -r!   r|   c            
       ób  • \ rS rSrSrSS\R                  SS4S jjrS\4S jr	SS jr
SS	 jrS S
 jrS\S\SS4S jrS\S\SS4S jrSS jrS\4S jrS\S\S\R*                  S\S\4
S jrS\S\SS4S jrS\S\4S jrS\S\R2                  S\S\4S jrS\S\SS4S jrS\S\4S jrSrg)!r   i  z�Libvirt event adapter to asyncio.

:param loop: asyncio's event loop

If *loop* is not specified, the current (or default) event loop is used.
NrY   r   c                 óò   • U=(       d    [         R                  " 5       U l        0 U l        [	        U 5      U l        [        R                  " U R                  R                  5      U l
        SU l        S U l        g )Nr   )r†   Úget_event_looprY   r?   rj   ÚdescriptorsÚloggingÚ	getLoggerr   r$   r)   Ú_pendingÚ	_finished)r   rY   s     r   r   ÚvirEventAsyncIOImpl.__init__  sW   € Ø×4œG×2Ò2Ó4ˆŒ	ØˆŒÜ)¨$Ó/ˆÔÜ×$Ò$ T§^¡^×%<Ñ%<Ó=ˆŒàˆŒð ˆ�r!   c                 óv   • SR                  [        U 5      R                  U R                  U R                  5      $ )Nz <{} callbacks={} descriptors={}>)r#   Útyper$   r?   r—   r%   s    r   r&   ÚvirEventAsyncIOImpl.__repr__+  s2   € Ø1×8Ñ8Ü�‹J×Ñ §¡°×1AÑ1AóCð 	Cr!   c                 ó~   • U =R                   S-  sl         U R                  b  U R                  R                  5         gg)z;Increase the count of pending affairs. Do not use directly.é   N)rš   r›   Úclearr%   s    r   Ú_pending_incÚ virEventAsyncIOImpl._pending_inc/  s/   € à�Š˜Ñ�Ø�>‰>Ñ%Ø�N‰N× Ñ Õ"ð &r!   c                 óÄ   • U R                   S:”  d   eU =R                   S-  sl         U R                   S:X  a)  U R                  b  U R                  R                  5         ggg)z;Decrease the count of pending affairs. Do not use directly.r   r¡   N)rš   r›   Úsetr%   s    r   Ú_pending_decÚ virEventAsyncIOImpl._pending_dec5  sO   € à�}‰}˜qÓ Ð Ð Ø�Š˜Ñ�Ø�=‰=˜AÓ $§.¡.Ñ"<Ø�N‰N×ÑÕ ð #=Ðr!   c                 óê   • U R                   R                  S5        [        R                  " U R                  U R
                  U R                  U R                  U R                  U R                  5        U $ )z3Register this instance as event loop implementationz
register())
r)   r*   rJ   ÚvirEventRegisterImplÚ_add_handleÚ_update_handleÚ_remove_handleÚ_add_timeoutÚ_update_timeoutÚ_remove_timeoutr%   s    r   ÚregisterÚvirEventAsyncIOImpl.register<  s\   € ð 	�‰�‰�|Ô$Ü×$Ò$Ø×Ñ˜d×1Ñ1°4×3FÑ3FØ×Ñ˜t×3Ñ3°T×5IÑ5Iô	Kð ˆr!   r   r   c                 ó`   • [         R                  " U R                  X5      U R                  S9  g)z8Schedule a ff callback from one of the handles or timersr�   N)r†   rŽ   Ú_ff_callbackrY   ©r   r   r   s      r   r+   Ú(virEventAsyncIOImpl.schedule_ff_callbackE  s!   € ä×Ò˜d×/Ñ/°Ó=ÀDÇIÁIÓNr!   c              ƒ   ó�   #   • U R                   R                  SU5        [        R                  " U5        U R	                  5         g7f)z6Directly free the opaque object

This is a coroutine.
z ff_callback(iden=%d, opaque=...)N)r)   r*   rJ   ÚvirEventInvokeFreeCallbackr§   rµ   s      r   r´   Ú virEventAsyncIOImpl._ff_callbackI  s4   é € ð
 	�‰�‰Ð9¸4Ô@Ü×*Ò*¨6Ô2Ø×ÑÕùs   ‚AAc              ƒ   óf  #   • U R                   R                  S5        U R                  (       ad  U R                  b   e[        R
                  " 5       U l        U R                  R                  5       I Sh  v•N   SU l        U R                  S:X  d   eU R                   R                  S5        g N97f)zBWait for the implementation to become idle.

This is a coroutine.
zdrain()Nr   zdrain ended)r)   r*   rš   r›   r†   ÚEventÚwaitr%   s    r   ÚdrainÚvirEventAsyncIOImpl.drainR  s   é € ð
 	�‰�‰�yÔ!Ø�=�=Ø—>‘>Ñ)Ð)Ð)Ü$Ÿ]š]›_ˆDŒNØ—.‘.×%Ñ%Ó'×'Ð'Ø!ˆDŒNØ—=‘= AÓ%Ð%Ð%Ø�‰�‰�}Õ%ñ (ùs   ‚A3B1Á5B/Á6:B1c                 óT   • U R                   (       + =(       a    U R                  (       + $ )z»Returns False if there are leftovers from a connection

Those may happen if there are sematical problems while closing
a connection. For example, not deregistered events before .close().
)r?   rš   r%   s    r   Úis_idleÚvirEventAsyncIOImpl.is_idle`  s   € ð —>‘>Ô!×7¨$¯-©-Ô&7Ð7r!   r=   rA   r   c                 ó^  • [        XUU R                  U   US9nUR                  U R                  ;  d   eU R                  R                  SXUR                  5        XPR                  UR                  '   U R                  U   R                  U5        U R                  5         UR                  $ )aÏ  Register a callback for monitoring file handle events

:param int fd: file descriptor to listen on
:param int event: bitset of events on which to fire the callback
:param cb: the callback to be called when an event occurrs
:param opaque: user data to pass to the callback
:rtype: int
:returns: handle watch number to be used for updating and unregistering for events

.. seealso::
    https://libvirt.org/html/libvirt-libvirt-event.html#virEventAddHandleFuncFunc
rz   z4add_handle(fd=%d, event=%d, cb=..., opaque=...) = %d)rg   r—   r   r?   r)   r*   ra   r£   )r   r=   rA   r   r   rE   s         r   r«   ÚvirEventAsyncIOImpl._add_handleh  s”   € ô ˜d¨Ø)-×)9Ñ)9¸"Ñ)=ÀUñLˆà�}‰} D§N¡NÓ2Ð2Ð2à�‰�‰ÐMØ (§-¡-ô	1à(0�‰�x—}‘}Ñ%Ø×Ñ˜Ñ×'Ñ'¨Ô1Ø×ÑÔØ�}‰}Ðr!   Úwatchc                 ó¦   • U R                   R                  SX5        U R                  U   n[        U[        5      (       d   eUR                  US9  g)zéChange event set for a monitored file handle

:param int watch: file descriptor watch to modify
:param int event: new events to listen on

.. seealso::
    https://libvirt.org/html/libvirt-libvirt-event.html#virEventUpdateHandleFunc
z!update_handle(watch=%d, event=%d))rA   N)r)   r*   r?   Ú
isinstancerg   r^   )r   rÄ   rA   rE   s       r   r¬   Ú"virEventAsyncIOImpl._update_handle€  sF   € ð 	�‰�‰Ð:¸EÔIØ—>‘> %Ñ(ˆÜ˜(¤J×/Ñ/Ð/Ð/Ø�‰˜eˆÒ$r!   c                 ó  • U R                   R                  SU5         U R                  R                  U5      n[        U[        5      (       d   eUR                  R                  nX R                  U   R                  U5      L d   e[        U R                  U   R                  5      S:X  a  U R                  U	 UR                  5         g! [         a3  nU R                   R                  SUR                  S   5         SnAgSnAff = f)zëUnregister a callback from a file handle.

:param int watch: file descriptor watch to stop listening on
:returns: -1 on error, 0 on success

.. seealso::
    https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveHandleFunc
zremove_handle(watch=%d)z#remove_handle(): no such handle: %rr   Nr   )r)   r*   r?   rd   ÚKeyErrorÚwarningr   rÆ   rg   ro   r=   r—   re   Úlenr,   )r   rÄ   rE   Úerrr=   s        r   r­   Ú"virEventAsyncIOImpl._remove_handleŽ  sã   € ð 	�‰�‰Ð0°%Ô8ð	Ø—~‘~×)Ñ)¨%Ó0ˆHô ˜(¤J×/Ñ/Ð/Ð/Ø× Ñ ×#Ñ#ˆØ×+Ñ+¨BÑ/×=Ñ=¸eÓDÒDÐDÐDÜˆt×Ñ Ñ#×-Ñ-Ó.°!Ó3Ø× Ñ  Ð$Ø�‰ÔØøô ó 	Ø�H‰H×ÑÐBÀCÇHÁHÈQÁKÔPÜûð	ús   žC Ã
D	Ã)DÄD	r€   c                 ó$  • [        XU5      nUR                  U R                  ;  d   eU R                  R	                  SXR                  5        X@R                  UR                  '   UR                  US9  U R                  5         UR                  $ )a=  Register a callback for a timer event

:param int timeout: the timeout to monitor
:param cb: the callback to call when timeout has expired
:param opaque: user data to pass to the callback
:rtype: int
:returns: a timer value

.. seealso::
    https://libvirt.org/html/libvirt-libvirt-event.html#virEventAddTimeoutFunc
z0add_timeout(timeout=%d, cb=..., opaque=...) = %dr’   )r|   r   r?   r)   r*   r^   r£   )r   r€   r   r   rE   s        r   r®   Ú virEventAsyncIOImpl._add_timeout¥  st   € ô # 4¨VÓ4ˆØ�}‰} D§N¡NÓ2Ð2Ð2à�‰�‰ÐIØ§¡ô	/à(0�‰�x—}‘}Ñ%Ø�‰ ˆÑ(Ø×ÑÔØ�}‰}Ðr!   Útimerc                 ó¦   • U R                   R                  SX5        U R                  U   n[        U[        5      (       d   eUR                  US9  g)zÔChange frequency for a timer

:param int timer: the timer to modify
:param int timeout: the new timeout value in ms

.. seealso::
    https://libvirt.org/html/libvirt-libvirt-event.html#virEventUpdateTimeoutFunc
z$update_timeout(timer=%d, timeout=%d)r’   N)r)   r*   r?   rÆ   r|   r^   )r   rÐ   r€   rE   s       r   r¯   Ú#virEventAsyncIOImpl._update_timeout»  sF   € ð 	�‰�‰Ð=¸uÔNØ—>‘> %Ñ(ˆÜ˜(¤O×4Ñ4Ð4Ð4Ø�‰ ˆÒ(r!   c                 ó  • U R                   R                  SU5         U R                  R                  U5      nUR                  5         g! [         a3  nU R                   R                  SUR                  S   5         SnAgSnAff = f)zÍUnregister a callback for a timer

:param int timer: the timer to remove
:returns: -1 on error, 0 on success

.. seealso::
    https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveTimeoutFunc
zremove_timeout(timer=%d)z%remove_timeout(): no such timeout: %rr   Nr   )r)   r*   r?   rd   rÉ   rÊ   r   r,   )r   rÐ   rE   rÌ   s       r   r°   Ú#virEventAsyncIOImpl._remove_timeoutÉ  sq   € ð 	�‰�‰Ð1°5Ô9ð	Ø—~‘~×)Ñ)¨%Ó0ˆHð 	�‰ÔØøô	 ó 	Ø�H‰H×ÑÐDÀcÇhÁhÈqÁkÔRÜûð	ús   žA
 Á

BÁ)BÂB)r›   rš   r?   r—   r)   rY   r   r.   )r   r   )r$   r/   r0   r1   r2   r†   ÚAbstractEventLoopr   r6   r&   r£   r§   r±   r5   r	   r+   r´   r½   ÚboolrÀ   rJ   Ú_EventCBr«   r¬   r­   Ú_TimerCBr®   r¯   r°   r7   rh   r!   r   r   r     s6  † ññ
˜W×6Ñ6ð 
À$õ 
ðC˜#ô Cô#ô!ôðO¨ð O°bð O¸Tô Oð sð °Bð ¸4ô ô&ð8˜ô 8ð˜cð ¨#ð °7×3CÑ3Cð ÈRð ÐTWô ð0% Cð %°ð %¸ô %ð Cð ¨Cô ð. Cð ¨W×-=Ñ-=ð Àrð Ècô ð,) Sð )°3ð )¸4ô )ð Sð ¨S÷ r!   r   r   c                  ó   • [         $ )z@Return the current implementation, or None if not yet registered)Ú_current_implrh   r!   r   r
   r
   ß  s   € äÐr!   rY   c                 ó<   • [        U S9R                  5       q[        $ )z Arrange for libvirt's callbacks to be dispatched via asyncio event loop

The implementation object is returned, but in normal usage it can safely be
discarded.
r�   )r   r±   rÚ   r�   s    r   r   r   ä  s   € ô (¨TÑ2×;Ñ;Ó=€MÜÐr!   r   )r2   r†   r3   r˜   rV   rJ   Útypingr   r   r   r   r   r   r	   Ú
__author__Ú__license__Ú__all__Úobjectr   r;   Údictrj   rg   r|   r   rÚ   r
   rÕ   r   rh   r!   r   Ú<module>râ      s½   ðñ(ó< Û Û Û ã ç D× DÙˆTƒ]€à;€
Ø€ò€ô?ˆvô ?ô>M�ô Mô`�Tô ô!�ô !ô62-�hô 2-ôrB˜&ô BðJ €ð˜Ð!4Ñ5ô ñ
 g×&?Ñ&?ð ÐK^ö r!   