+
    ~j "                        R t ^ RIHt ^ RIt^ RI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# )zIAsync wrapper around :class:`SoftReadWriteLock` for use with ``asyncio``.)annotationsN)asynccontextmanager)TYPE_CHECKING)SoftReadWriteLock)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	# )
$AsyncAcquireSoftReadWriteReturnProxyzTAsync context-aware object that releases an :class:`AsyncSoftReadWriteLock` on exit.c                    V ^8  d   QhRRRR/# )   lockAsyncSoftReadWriteLockreturnNone )formats   "m/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/filelock/_soft_rw/_async.py__annotate__1AsyncAcquireSoftReadWriteReturnProxy.__annotate__   s      3      c                	    Wn         R # Nr   )selfr   s   &&r   __init__-AsyncAcquireSoftReadWriteReturnProxy.__init__   s    	r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r      s      "8 r   c                	"   "   V P                   # 5ir   r   r   s   &r   
__aenter__/AsyncAcquireSoftReadWriteReturnProxy.__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__.AsyncAcquireSoftReadWriteReturnProxy.__aexit__   s      ii!!!s   )')r   N)	__name__
__module____qualname____firstlineno____doc__r   r!   r)   __static_attributes__r   r   r   r   r      s    ^" "r   r   c                  X   ] tR t^%tRtR*RRRRR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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' R( ltR)tR# ),r   a  
Async wrapper around :class:`SoftReadWriteLock` for ``asyncio`` applications.

The sync class's blocking filesystem operations run on a thread pool via ``loop.run_in_executor()``.
Reentrancy, upgrade/downgrade rules, fork handling, heartbeat and TTL stale detection, and singleton
behavior are delegated to the underlying :class:`SoftReadWriteLock`.

:param lock_file: path to the lock file; sidecar state/write/readers live next to it
:param timeout: maximum wait time in seconds; ``-1`` means block indefinitely
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately on contention
:param is_singleton: if ``True``, reuse existing :class:`SoftReadWriteLock` instances per resolved path
:param heartbeat_interval: seconds between heartbeat refreshes; default 30 s
:param stale_threshold: seconds of mtime inactivity before a marker is stale; defaults to ``3 * heartbeat_interval``
:param poll_interval: seconds between acquire retries under contention; default 0.25 s
: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.27.0

blockingTis_singletonheartbeat_intervalg      >@stale_thresholdNpoll_intervalg      ?loopexecutorc               @    V ^8  d   QhRRRRRRRRRRR	R
RRRRRRRR/
# )r   	lock_filezstr | os.PathLike[str]timeoutfloatr2   boolr3   r4   r5   float | Noner6   r7    asyncio.AbstractEventLoop | Noner8   futures.Executor | Noner   r   r   )r   s   "r   r   #AsyncSoftReadWriteLock.__annotate__;   sn     " ")" "
 " " "" &" " /" *" 
"r   c          
     	L    \        VVVVVVVR 7      V n        Wn        Wn        R# ))r2   r3   r4   r5   r6   N)r   _lock_loop	_executor)
r   r:   r;   r2   r3   r4   r5   r6   r7   r8   s
   &&&$$$$$$$r   r   AsyncSoftReadWriteLock.__init__;   s1     '%1+'

 
!r   c                   V ^8  d   QhRR/# )r   r   strr   )r   s   "r   r   rA   U   s     $ $3 $r   c                .    V P                   P                  # )z>:returns: the path to the lock file passed to the constructor.)rC   r:   r    s   &r   r:    AsyncSoftReadWriteLock.lock_fileT   s     zz###r   c                   V ^8  d   QhRR/# )r   r   r<   r   )r   s   "r   r   rA   Z   s     " " "r   c                .    V P                   P                  # )zf:returns: the default timeout applied when ``acquire_read`` / ``acquire_write`` is called without one.)rC   r;   r    s   &r   r;   AsyncSoftReadWriteLock.timeoutY   s     zz!!!r   c                   V ^8  d   QhRR/# )r   r   r=   r   )r   s   "r   r   rA   _   s     # #$ #r   c                .    V P                   P                  # )zc:returns: whether ``acquire_*`` defaults to blocking; ``False`` makes contention raise immediately.)rC   r2   r    s   &r   r2   AsyncSoftReadWriteLock.blocking^   s     zz"""r   c                   V ^8  d   QhRR/# )r   r   r?   r   )r   s   "r   r   rA   d   s      6 r   c                    V P                   # )zX:returns: the event loop used for ``run_in_executor``, or ``None`` for the running loop.)rD   r    s   &r   r7   AsyncSoftReadWriteLock.loopc   s     zzr   c                   V ^8  d   QhRR/# )r   r   r@   r   )r   s   "r   r   rA   i   s      1 r   c                    V P                   # )zZ:returns: the executor used for ``run_in_executor``, or ``None`` for the default executor.)rE   r    s   &r   r8   AsyncSoftReadWriteLock.executorh   s     ~~r   c               $    V ^8  d   QhRRRRRR/# r   r;   r>   r2   bool | Noner   r   r   )r   s   "r   r   rA   m   s$     ? ?#?9D?	-?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:`SoftReadWriteLock.acquire_read` for the full reentrancy / upgrade / fork semantics. The blocking
work runs inside ``run_in_executor`` so other coroutines on the same loop continue to progress while this
call waits.

: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

:returns: a proxy usable as an async context manager to release the lock

:raises RuntimeError: if a write lock is already held, if this instance was invalidated by
    :func:`os.fork`, or if :meth:`close` was called
:raises Timeout: if the lock cannot be acquired within *timeout* seconds

r2   Nr   )_runrC   acquire_readr   r   r;   r2   s   &&$r   r]   #AsyncSoftReadWriteLock.acquire_readm   s8     ( ii

//iLLL3>> 	M   +A >A c               $    V ^8  d   QhRRRRRR/# rX   r   )r   s   "r   r   rA      s$     ? ?#?9D?	-?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:`SoftReadWriteLock.acquire_write` for the two-phase writer-preferring semantics. The blocking
work runs inside ``run_in_executor``.

: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

:returns: a proxy usable as an async context manager to release the lock

:raises RuntimeError: if a read lock is already held, if a write lock is held by a different thread, if
    this instance was invalidated by :func:`os.fork`, or if :meth:`close` was called
:raises Timeout: if the lock cannot be acquired within *timeout* seconds

r[   Nr   )r\   rC   acquire_writer   r^   s   &&$r   rc   $AsyncSoftReadWriteLock.acquire_write   s8     & ii

00'iMMM3>> 	Nr`   forceFc                    V ^8  d   QhRRRR/# )r   re   r=   r   r   r   )r   s   "r   r   rA      s     	9 	9d 	9t 	9r   c               p   "   V P                  V P                  P                  VR7      G Rj  xL
  R#  L5i)z
Release one level of the current lock.

: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``

)re   N)r\   rC   r(   )r   re   s   &$r   r(   AsyncSoftReadWriteLock.release   s'      ii

**%i888s   +646c               $    V ^8  d   QhRRRRRR/# r   r;   r>   r2   rY   r   zAsyncGenerator[None]r   )r   s   "r   r   rA      s"     ! !| ! !`t !r   c                 "   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.

: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

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

r[   N)r]   r(   r^   s   &&$r   	read_lock AsyncSoftReadWriteLock.read_lock   sN      ;;;	!,,.  	 	< !$,,.  >   A=AA A?AAAAAAc               $    V ^8  d   QhRRRRRR/# rj   r   )r   s   "r   r   rA      s"     ! ! !+ !au !r   c                 "   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.

: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

: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

r[   N)rc   r(   r^   s   &&$r   
write_lock!AsyncSoftReadWriteLock.write_lock   sN         <<<	!,,.  	 	= !$,,.  rn   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   rA      s     * *T *r   c                l   "   V P                  V P                  P                  4      G Rj  xL
  R#  L5i)zRRelease any held lock and release the underlying filesystem resources. Idempotent.N)r\   rC   closer    s   &r   ru   AsyncSoftReadWriteLock.close   s!     ii

(()))s   )424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   rA      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   )rD   asyncioget_running_looprun_in_executorrE   	functoolspartial)r   rx   ry   r{   r7   s   &&*, r   r\   AsyncSoftReadWriteLock._run   sS     zz77W557))$..):K:KD:bSW:b[a:bccccs   A!A*#A($A*)rE   rC   rD   )r   )r+   r,   r-   r.   r/   r   propertyr:   r;   r2   r7   r8   r]   rc   r(   r   rl   rq   ru   r\   r0   r   r   r   r   r   %   s4   *"
 " "" %)" )-"  $" 26" -1" "2 $ $ " " # #    ?GK? ?.?GK? ?,	9U 	9 !W[ ! !" !X\ ! !"*d dr   r   )r/   
__future__r   r}   r   
contextlibr   typingr   _syncr   oscollections.abcr   r   
concurrentr   typesr	   r   r   __all__r   r   r   <module>r      sQ    O "   *   $8"#" "$jd jd\ +r   