# Stubs for multiprocessing.pool

# 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: ...
