Format: application/x-python-code
⬇ Download File (4.0 KB)
   1  o
   2  
   3  ;'h�@s�ddlmZddlZddlmZmZddlmZmZddl	m
   4  Z
   5  ddlmZm
   6  Z
   7  mZmZmZejdkr<ddlmZmZnddlmZmZerLd	d
   8  lmZed�Zedd
   9  d�Zed�ZGdd�dee�ZGdd�ded�ZdS)�)�annotationsN)�ABCMeta�abstractmethod)�	Awaitable�Callable)�
  10  TracebackType)�
  11  TYPE_CHECKING�Any�Protocol�TypeVar�overload)��)�TypeVarTuple�Unpack�)�CancelScope�T_Retval�T_contraT)�
  12  contravariant�PosArgsTc@s4eZdZed
  13  dd��Zedd	d��Zdddd�Zd
  14  S)�
  15  TaskStatus�self�TaskStatus[None]�return�NonecC�dS�N��rrr�FC:\Users\shubh\Videos\agent\nova\Lib\site-packages\anyio/abc/_tasks.py�started�zTaskStatus.started�valuercCrrr�rr#rrr r!r"N�T_contra | NonecC�dS)zx
  16          Signal that the task has started.
  17  
  18          :param value: object passed back to the starter of the task
  19          Nrr$rrr r!�)rrrr)r#rrrr)r#r%rr)�__name__�
  20  __module__�__qualname__rr!rrrr rsrc@s^eZdZUdZded<edd�ddd��Zedd�d dd��Zed!dd��Zed"dd��Z	dS)#�	TaskGroupa
  21      Groups several asynchronous tasks together.
  22  
  23      :ivar cancel_scope: the cancel scope inherited by all child tasks
  24      :vartype cancel_scope: CancelScope
  25  
  26      .. note:: On asyncio, support for eager task factories is considered to be
  27          **experimental**. In particular, they don't follow the usual semantics of new
  28          tasks being scheduled on the next iteration of the event loop, and may thus
  29          cause unexpected behavior in code that wasn't written with such semantics in
  30          mind.
  31      rZcancel_scopeN)�name�func�,Callable[[Unpack[PosArgsT]], Awaitable[Any]]�args�Unpack[PosArgsT]r,�objectrrcGr&)a
  32          Start a new task in this task group.
  33  
  34          :param func: a coroutine function
  35          :param args: positional arguments to call the function with
  36          :param name: name of the task, for the purposes of introspection and debugging
  37  
  38          .. versionadded:: 3.0
  39          Nr�rr-r,r/rrr �
  40  start_soon5r'zTaskGroup.start_soon�Callable[..., Awaitable[Any]]r	c���dS)a�
  41          Start a new task and wait until it signals for readiness.
  42  
  43          :param func: a coroutine function
  44          :param args: positional arguments to call the function with
  45          :param name: name of the task, for the purposes of introspection and debugging
  46          :return: the value passed to ``task_status.started()``
  47          :raises RuntimeError: if the task finishes without calling
  48              ``task_status.started()``
  49  
  50          .. versionadded:: 3.0
  51          Nrr2rrr �startF�zTaskGroup.startc�r5)z:Enter the task group context and allow starting new tasks.Nrrrrr �
  52  __aenter__Zr7zTaskGroup.__aenter__�exc_type�type[BaseException] | None�exc_val�BaseException | None�exc_tb�TracebackType | None�bool | Nonec�r5)z<Exit the task group context waiting for all tasks to finish.Nr)rr9r;r=rrr �	__aexit__^r7zTaskGroup.__aexit__)r-r.r/r0r,r1rr)r-r4r/r1r,r1rr	)rr+)r9r:r;r<r=r>rr?)
  53  r(r)r*�__doc__�__annotations__rr3r6r8r@rrrr r+%s
  54  
  55  ��r+)�	metaclass)�
  56  __future__r�sys�abcrr�collections.abcrr�typesr�typingrr	r
  57  rr�version_inforrZtyping_extensionsZ_core._tasksrrrrrr+rrrr �<module>s 
  58