+
    wi	                     Z    R t ^ RIHtHtHt ^ RIt]! R4      t ! R R]],          4      tR# )z
Resolver - An anyio-compatible future-like object for async result passing.

This provides a simple way to pass a result (or exception) from one coroutine
to another without depending on asyncio.Future.
)GenericTypeVarcastNTc                   ~   a  ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	Rt
V tR# )ResolveraE  
A simple resolver for passing results between coroutines.

Unlike asyncio.Future, this works with any anyio-compatible async backend.

Usage:
    resolver: Resolver[str] = Resolver()

    # In one coroutine:
    resolver.set_result("hello")

    # In another coroutine:
    result = await resolver.wait()  # returns "hello"
c                   < V ^8  d   QhRR/# )   returnN )format__classdict__s   "Z/home/ubuntu/.local/lib/python3.14/site-packages/mcp/shared/experimental/tasks/resolver.py__annotate__Resolver.__annotate__   s     5 5$ 5    c                V    \         P                  ! 4       V n        R V n        R V n        R # )N)anyioEvent_event_value
_exceptionselfs   &r   __init__Resolver.__init__   s    kkm $04r   c                $   < V ^8  d   QhRS[ RR/# )r	   valuer
   Nr   )r   r   s   "r   r   r   $   s       d r   c                    V P                   P                  4       '       d   \        R4      hWn        V P                   P	                  4        R# )z)Set the result value and wake up waiters.Resolver already completedN)r   is_setRuntimeErrorr   set)r   r   s   &&r   
set_resultResolver.set_result$   s4    ;;;<<r   c                $   < V ^8  d   QhRS[ RR/# )r	   excr
   N)BaseException)r   r   s   "r   r   r   +   s       4 r   c                    V P                   P                  4       '       d   \        R4      hWn        V P                   P	                  4        R# )z%Set an exception and wake up waiters.r    N)r   r!   r"   r   r#   )r   r'   s   &&r   set_exceptionResolver.set_exception+   s4    ;;;<<r   c                    < V ^8  d   QhRS[ /# r	   r
   r   )r   r   s   "r   r   r   2   s     $ $A $r   c                   "   V P                   P                  4       G Rj  xL
  V P                  e   V P                  h\        \        V P
                  4      #  L85i)z:Wait for the result and return it, or raise the exception.N)r   waitr   r   r   r   r   s   &r   r/   Resolver.wait2   sE     kk   ??&//!At{{##	 	!s   AA9Ac                    < V ^8  d   QhRS[ /# r-   )bool)r   r   s   "r   r   r   :   s     $ $d $r   c                6    V P                   P                  4       # )z/Return True if the resolver has been completed.)r   r!   r   s   &r   doneResolver.done:   s    {{!!##r   )r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r$   r*   r/   r4   __static_attributes____classdictcell__)r   s   @r   r   r      s<     5 5
  $ $$ $r   r   )r:   typingr   r   r   r   r   r   r   r   r   <module>r>      s.    * ) CL-$wqz -$r   