Add multiprocessing.resource_sharer submodule (#8413)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Kevin Kirsche
2022-07-28 11:09:18 -04:00
committed by GitHub
parent 177bbf7864
commit dd24bba3dd

View File

@@ -0,0 +1,25 @@
import sys
from socket import socket
from typing import Union
from typing_extensions import TypeAlias
__all__ = ["stop"]
# https://docs.python.org/3/library/multiprocessing.html#address-formats
_Address: TypeAlias = Union[str, tuple[str, int]]
if sys.platform == "win32":
__all__ += ["DupSocket"]
class DupSocket:
def __init__(self, sock: socket) -> None: ...
def detach(self) -> socket: ...
else:
__all__ += ["DupFd"]
class DupFd:
def __init__(self, fd: int) -> None: ...
def detach(self) -> int: ...
def stop(timeout: float | None = ...) -> None: ...