mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Add type information for asyncio.transports
This commit is contained in:
@@ -4,6 +4,14 @@ from asyncio.coroutines import (
|
||||
iscoroutinefunction as iscoroutinefunction,
|
||||
iscoroutine as iscoroutine,
|
||||
)
|
||||
from asyncio.transports import (
|
||||
BaseTransport as BaseTransport,
|
||||
ReadTransport as ReadTransport,
|
||||
WriteTransport as WriteTransport,
|
||||
Transport as Transport,
|
||||
DatagramTransport as DatagramTransport,
|
||||
SubprocessTransport as SubprocessTransport,
|
||||
)
|
||||
from asyncio.futures import (
|
||||
Future as Future,
|
||||
)
|
||||
@@ -33,6 +41,7 @@ from asyncio.queues import (
|
||||
)
|
||||
|
||||
__all__ = (coroutines.__all__ +
|
||||
transports.__all__ +
|
||||
futures.__all__ +
|
||||
tasks.__all__ +
|
||||
events.__all__ +
|
||||
|
||||
39
stdlib/3.4/asyncio/transports.pyi
Normal file
39
stdlib/3.4/asyncio/transports.pyi
Normal file
@@ -0,0 +1,39 @@
|
||||
from typing import Dict, Any, TypeVar, Mapping, List
|
||||
|
||||
__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport',
|
||||
'Transport', 'DatagramTransport', 'SubprocessTransport',
|
||||
]
|
||||
|
||||
class BaseTransport:
|
||||
def __init__(self, extra: Mapping[Any, Any] = ...) -> None: ...
|
||||
def get_extra_info(self, name: Any, default: Any = ...) -> Any: ...
|
||||
def is_closing(self) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class ReadTransport(BaseTransport):
|
||||
def pause_reading(self) -> None: ...
|
||||
def resume_reading(self) -> None: ...
|
||||
|
||||
class WriteTransport(BaseTransport):
|
||||
def set_write_buffer_limits(
|
||||
self, high: int = ..., low: int = ...) -> None: ...
|
||||
def get_write_buffer_size(self) -> int: ...
|
||||
def write(self, data: Any) -> None: ...
|
||||
def writelines(self, list_of_data: List[Any]): ...
|
||||
def write_eof(self) -> None: ...
|
||||
def can_write_eof(self) -> bool: ...
|
||||
def abort(self) -> None: ...
|
||||
|
||||
class Transport(ReadTransport, WriteTransport): ...
|
||||
|
||||
class DatagramTransport(BaseTransport):
|
||||
def sendto(self, data: Any, addr: str = ...) -> None: ...
|
||||
def abort(self) -> None: ...
|
||||
|
||||
class SubprocessTransport(BaseTransport):
|
||||
def get_pid(self) -> int: ...
|
||||
def get_returncode(self) -> int: ...
|
||||
def get_pipe_transport(self, fd: int) -> BaseTransport: ...
|
||||
def send_signal(self, signal: int) -> int: ...
|
||||
def terminate(self) -> None: ...
|
||||
def kill(self) -> None: ...
|
||||
Reference in New Issue
Block a user