+
    ~jO                        R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^RIHt ]
'       d   ^ RIt^ RIHtHt ^ RIHt ^ R	IHt  ! R
 R4      t ! R R4      tRR.tR# )zEAsync wrapper around :class:`ReadWriteLock` for use with ``asyncio``.)annotationsN)ThreadPoolExecutor)asynccontextmanager)TYPE_CHECKING)ReadWriteLock)AsyncGeneratorCallable)futures)TracebackTypec                  >    ] tR t^tRtR R ltR R ltR R ltRtR	# )
 AsyncAcquireReadWriteReturnProxyzEContext-aware object that releases the async read/write lock on exit.c                    V ^8  d   QhRRRR/# )   lockAsyncReadWriteLockreturnNone )formats   "o/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/filelock/_async_read_write.py__annotate__-AsyncAcquireReadWriteReturnProxy.__annotate__   s      / D     c                	    Wn         R # Nr   )selfr   s   &&r   __init__)AsyncAcquireReadWriteReturnProxy.__init__   s    	r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r      s      "4 r   c                	"   "   V P                   # 5ir   r   r   s   &r   
__aenter__+AsyncAcquireReadWriteReturnProxy.__aenter__   s     yys   c               (    V ^8  d   QhRRRRRRRR/# )	r   exc_typeztype[BaseException] | None	exc_valuezBaseException | None	tracebackzTracebackType | Noner   r   r   )r   s   "r   r   r      s2     " "," (" (	"
 
"r   c                	V   "   V P                   P                  4       G R j  xL
  R #  L5ir   )r   release)r   r%   r&   r'   s   &&&&r   	__aexit__*AsyncAcquireReadWriteReturnProxy.__aexit__   s      ii!!!s   )')r   N)	__name__
__module____qualname____firstlineno____doc__r   r"   r*   __static_attributes__r   r   r   r   r      s    O" "r   r   c            	      L   ] tR t^&tRtR%RRRRRRRR/R R	 l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tR%RR/R R llltR%RR/R R llltRR/R R llt]R&RR/R R lll4       t]R&RR/R  R! lll4       tR" R# ltR$tR# )'r   a  
Async wrapper around :class:`ReadWriteLock` for use in ``asyncio`` applications.

Because Python's :mod:`sqlite3` module has no async API, all blocking SQLite operations are dispatched to a thread
pool via ``loop.run_in_executor()``. Reentrancy, upgrade/downgrade rules, and singleton behavior are delegated
to the underlying :class:`ReadWriteLock`.

:param lock_file: path to the SQLite database file used as the lock
:param timeout: maximum wait time in seconds; ``-1`` means block indefinitely
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable
:param is_singleton: if ``True``, reuse existing :class:`ReadWriteLock` instances for the same resolved path
:param loop: event loop for ``run_in_executor``; ``None`` uses the running loop
:param executor: executor for ``run_in_executor``; ``None`` uses the default executor

.. versionadded:: 3.21.0

blockingTis_singletonloopNexecutorc               4    V ^8  d   QhRRRRRRRRRR	R
RRR/# )r   	lock_filezstr | os.PathLike[str]timeoutfloatr3   boolr4   r5    asyncio.AbstractEventLoop | Noner6   futures.Executor | Noner   r   r   )r   s   "r   r   AsyncReadWriteLock.__annotate__9   sY     G G)G G
 G G /G *G 
Gr   c               	~    \        WW4R 7      V n        WPn        VRJ V n        T;'       g    \	        ^R7      V n        R# ))r3   r4   N)max_workers)r   _lock_loop_owns_executorr   	_executor)r   r8   r9   r3   r4   r5   r6   s   &&&$$$$r   r   AsyncReadWriteLock.__init__9   s9     #9d

&$.!FF%7A%Fr   c                   V ^8  d   QhRR/# )r   r   strr   )r   s   "r   r   r>   I   s     $ $3 $r   c                .    V P                   P                  # )z$:returns: the path to the lock file.)rA   r8   r!   s   &r   r8   AsyncReadWriteLock.lock_fileH   s     zz###r   c                   V ^8  d   QhRR/# )r   r   r:   r   )r   s   "r   r   r>   N   s     " " "r   c                .    V P                   P                  # )z:returns: the default timeout.)rA   r9   r!   s   &r   r9   AsyncReadWriteLock.timeoutM   s     zz!!!r   c                   V ^8  d   QhRR/# )r   r   r;   r   )r   s   "r   r   r>   S   s     # #$ #r   c                .    V P                   P                  # )z1:returns: whether blocking is enabled by default.)rA   r3   r!   s   &r   r3   AsyncReadWriteLock.blockingR   s     zz"""r   c                   V ^8  d   QhRR/# )r   r   r<   r   )r   s   "r   r   r>   X   s      6 r   c                    V P                   # )z<:returns: the event loop (or ``None`` for the running loop).)rB   r!   s   &r   r5   AsyncReadWriteLock.loopW   s     zzr   c                   V ^8  d   QhRR/# )r   r   r=   r   )r   s   "r   r   r>   ]   s      1 r   c                    V P                   # )z5:returns: the executor (or ``None`` for the default).)rD   r!   s   &r   r6   AsyncReadWriteLock.executor\   s     ~~r   c               (    V ^8  d   QhRRRRRRRR/# )r   funczCallable[..., object]argsobjectkwargsr   r   )r   s   "r   r   r>   a   s0     d d4 dV dv dZ` dr   c                	   "   V P                   ;'       g    \        P                  ! 4       pVP                  V P                  \
        P                  ! V.VO5/ VB 4      G R j  xL
 #  L5ir   )rB   asyncioget_running_looprun_in_executorrD   	functoolspartial)r   rW   rX   rZ   r5   s   &&*, r   _runAsyncReadWriteLock._runa   sS     zz77W557))$..):K:KD:bSW:b[a:bccccs   A!A*#A($A*c               $    V ^8  d   QhRRRRRR/# r   r9   r:   r3   r;   r   r   r   )r   s   "r   r   r>   e   s"     ; ;% ;4 ;Ss ;r   c                  "   V P                  V P                  P                  WR7      G Rj  xL
  \        V R7      #  L5i)a  
Acquire a shared read lock.

See :meth:`ReadWriteLock.acquire_read` for full semantics.

:param timeout: maximum wait time in seconds; ``-1`` means block indefinitely
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable

:returns: a proxy that can be used as an async context manager to release the lock

:raises RuntimeError: if a write lock is already held on this instance
:raises Timeout: if the lock cannot be acquired within *timeout* seconds

r3   Nr   )ra   rA   acquire_readr   r   r9   r3   s   &&$r   rg   AsyncReadWriteLock.acquire_reade   s8      ii

//iLLL/T:: 	M   +A >A c               $    V ^8  d   QhRRRRRR/# rd   r   )r   s   "r   r   r>   w   s"     ; ;5 ;D ;Tt ;r   c                  "   V P                  V P                  P                  WR7      G Rj  xL
  \        V R7      #  L5i)a  
Acquire an exclusive write lock.

See :meth:`ReadWriteLock.acquire_write` for full semantics.

:param timeout: maximum wait time in seconds; ``-1`` means block indefinitely
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable

:returns: a proxy that can be used as an async context manager to release the lock

:raises RuntimeError: if a read lock is already held, or a write lock is held by a different thread
:raises Timeout: if the lock cannot be acquired within *timeout* seconds

rf   Nr   )ra   rA   acquire_writer   rh   s   &&$r   rm    AsyncReadWriteLock.acquire_writew   s8      ii

00'iMMM/T:: 	Nrj   forceFc                    V ^8  d   QhRRRR/# )r   ro   r;   r   r   r   )r   s   "r   r   r>      s     9 9d 9t 9r   c               p   "   V P                  V P                  P                  VR7      G Rj  xL
  R#  L5i)a
  
Release one level of the current lock.

See :meth:`ReadWriteLock.release` for full semantics.

:param force: if ``True``, release the lock completely regardless of the current lock level

:raises RuntimeError: if no lock is currently held and *force* is ``False``

)ro   N)ra   rA   r)   )r   ro   s   &$r   r)   AsyncReadWriteLock.release   s'      ii

**%i888s   +646c               $    V ^8  d   QhRRRRRR/# r   r9   zfloat | Noner3   zbool | Noner   zAsyncGenerator[None]r   )r   s   "r   r   r>      s"     ! !| ! !`t !r   c              *  "   Vf   V P                   P                  pVf   V P                   P                  pV P                  WR7      G Rj  xL
   R5x  V P	                  4       G Rj  xL
  R#  L$ L  T P	                  4       G Rj  xL 
  i ; i5i)a[  
Async context manager that acquires and releases a shared read lock.

Falls back to instance defaults for *timeout* and *blocking* when ``None``.

:param timeout: maximum wait time in seconds, or ``None`` to use the instance default
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately; ``None`` uses the instance default

Nrf   )rA   r9   r3   rg   r)   rh   s   &&$r   	read_lockAsyncReadWriteLock.read_lock   sw      ?jj((Gzz**H;;;	!,,.  	 	< !$,,.  H   A
BA1BA5 B*A3+B3B5B	B
BBc               $    V ^8  d   QhRRRRRR/# rt   r   )r   s   "r   r   r>      s"     ! ! !+ !au !r   c              *  "   Vf   V P                   P                  pVf   V P                   P                  pV P                  WR7      G Rj  xL
   R5x  V P	                  4       G Rj  xL
  R#  L$ L  T P	                  4       G Rj  xL 
  i ; i5i)a`  
Async context manager that acquires and releases an exclusive write lock.

Falls back to instance defaults for *timeout* and *blocking* when ``None``.

:param timeout: maximum wait time in seconds, or ``None`` to use the instance default
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately; ``None`` uses the instance default

Nrf   )rA   r9   r3   rm   r)   rh   s   &&$r   
write_lockAsyncReadWriteLock.write_lock   sw      ?jj((Gzz**H   <<<	!,,.  	 	= !$,,.  rx   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r>      s     	0 	0T 	0r   c                   "   V P                  V P                  P                  4      G Rj  xL
  V P                  '       d   V P                  P                  RR7       R# R#  L65i)z
Release the lock (if held) and close the underlying SQLite connection.

After calling this method, the lock instance is no longer usable.

NF)wait)ra   rA   closerC   rD   shutdownr!   s   &r   r   AsyncReadWriteLock.close   sN      ii

(()))NN###/  	*s   )A$A"A$!A$)rD   rA   rB   rC   )r   )r,   r-   r.   r/   r0   r   propertyr8   r9   r3   r5   r6   ra   rg   rm   r)   r   rv   r{   r   r1   r   r   r   r   r   &   s   $G
 G "G 26G -1G G $ $ " " # #    d;$ ; ;$;4 ; ;$9U 9 !W[ ! !( !X\ ! !(	0 	0r   r   )r0   
__future__r   r\   r_   concurrent.futuresr   
contextlibr   typingr   _read_writer   oscollections.abcr   r   
concurrentr	   typesr
   r   r   __all__r   r   r   <module>r      sR    K "   1 *   &8"#" "$c0 c0N 'r   