mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Added type declaration for multiprocessing.pool.ThreadPool and AsyncResult. (#143)
This commit is contained in:
committed by
Guido van Rossum
parent
68306484ae
commit
7389610937
@@ -2,5 +2,35 @@
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Any, Callable, Iterable, List, Sequence
|
||||
|
||||
class AsyncResult():
|
||||
def get(self, timeout: float = -1) -> Any: ...
|
||||
def wait(self, timeout: float = -1) -> None: ...
|
||||
def ready(self) -> bool: ...
|
||||
def successful(self) -> bool: ...
|
||||
|
||||
class ThreadPool():
|
||||
def __init__(self, processes: int = ...) -> None: ...
|
||||
def apply_async(self, func: Callable[..., Any],
|
||||
args: Sequence[Any]=(),
|
||||
kwds: Dict[str, Any]={},
|
||||
callback: Callable[..., None] = None) -> AsyncResult: ...
|
||||
def apply(self, func: Callable[..., Any],
|
||||
args: Sequence[Any]=(),
|
||||
kwds: Dict[str, Any]={}) -> Any: ...
|
||||
def map(self, func: Callable[..., Any],
|
||||
iterable: Iterable[Any]=()) -> List[Any]: ...
|
||||
def map_async(self, func: Callable[..., Any],
|
||||
iterable: Iterable[Any] = (),
|
||||
chunksize: int = -1,
|
||||
callback: Callable[..., None] = None) -> AsyncResult: ...
|
||||
def imap(self, func: Callable[..., Any],
|
||||
iterable: Iterable[Any]=()) -> Iterable[Any]: ...
|
||||
def imap_async(self, func: Callable[..., Any],
|
||||
chunksize: int = -1,
|
||||
iterable: Iterable[Any]=(),
|
||||
callback: Callable[..., None] = None) -> AsyncResult: ...
|
||||
def close(self) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
def join(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user