mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 12:51:27 +08:00
add some missing asyncio items such as gather (#511)
* add some missing asyncio items * sort items
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, Generator, Iterable, Awaitable, overload
|
||||
from typing import Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, Generator, Iterable, Awaitable, overload, Sequence, Iterator
|
||||
|
||||
__all__ = ... # type: str
|
||||
|
||||
@@ -9,11 +9,19 @@ FIRST_EXCEPTION = 'FIRST_EXCEPTION'
|
||||
FIRST_COMPLETED = 'FIRST_COMPLETED'
|
||||
ALL_COMPLETED = 'ALL_COMPLETED'
|
||||
_T = TypeVar('_T')
|
||||
def as_completed(fs: Sequence[Future[_T]], *, loop: AbstractEventLoop = ..., timeout=None) -> Iterator[Generator[Any, None, _T]]: ...
|
||||
def ensure_future(coro_or_future: Union[Future[_T], Generator[Any, None, _T]], *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def gather(*coros_or_futures: Sequence[Union[Future[_T], Generator[Any, None, _T]]], loop: AbstractEventLoop = ..., return_exceptions: bool = False) -> Future[_T]: ...
|
||||
def run_coroutine_threadsafe(coro: Generator[Any, None, _T], loop: AbstractEventLoop) -> Future[_T]: ...
|
||||
def shield(arg: Union[Future[_T], Generator[Any, None, _T]], *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def wait(fs: List[Task[_T]], *, loop: AbstractEventLoop = ...,
|
||||
timeout: float = ..., return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ...
|
||||
def wait_for(fut: Union[Future[_T], Generator[Any, None, _T]], timeout: float, *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
|
||||
class _GatheringFuture(Future[_T], Generic[_T]):
|
||||
def __init__(self, children: Sequence[Union[Future[_T], Generator[Any, None, _T]]], *, loop: AbstractEventLoop = ...) -> None: ...
|
||||
def cancel(self) -> bool: ...
|
||||
|
||||
class Task(Future[_T], Generic[_T]):
|
||||
_all_tasks = ... # type: Set[Task]
|
||||
|
||||
Reference in New Issue
Block a user