Skip to content

Commit 0679e02

Browse files
Sterbicmatthiaskramm
authored andcommitted
Add start, shutdown and context manager methods to BaseManager (#1392)
1 parent 4dd4046 commit 0679e02

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

stdlib/3/multiprocessing/managers.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
import queue
66
import threading
7-
from typing import Any, Dict, List, Mapping, Sequence, TypeVar
7+
from typing import (
8+
Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, TypeVar
9+
)
810

911
_T = TypeVar('_T')
1012
_KT = TypeVar('_KT')
@@ -16,6 +18,11 @@ _Namespace = Namespace
1618

1719
class BaseManager:
1820
def register(self, typeid: str, callable: Any = ...) -> None: ...
21+
def shutdown(self) -> None: ...
22+
def start(self, initializer: Optional[Callable[..., None]] = ...,
23+
initargs: Iterable[Any] = ...) -> None: ...
24+
def __enter__(self) -> 'BaseManager': ...
25+
def __exit__(self, exc_type, exc_value, tb) -> None: ...
1926

2027
class SyncManager(BaseManager):
2128
def BoundedSemaphore(self, value: Any = ...) -> threading.BoundedSemaphore: ...

0 commit comments

Comments
 (0)