mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-29 23:26:54 +08:00
Add type information for asyncio.protocols
This commit is contained in:
@@ -4,6 +4,12 @@ from asyncio.coroutines import (
|
||||
iscoroutinefunction as iscoroutinefunction,
|
||||
iscoroutine as iscoroutine,
|
||||
)
|
||||
from asyncio.protocols import (
|
||||
BaseProtocol as BaseProtocol,
|
||||
Protocol as Protocol,
|
||||
DatagramProtocol as DatagramProtocol,
|
||||
SubprocessProtocol as SubprocessProtocol,
|
||||
)
|
||||
from asyncio.transports import (
|
||||
BaseTransport as BaseTransport,
|
||||
ReadTransport as ReadTransport,
|
||||
@@ -41,6 +47,7 @@ from asyncio.queues import (
|
||||
)
|
||||
|
||||
__all__ = (coroutines.__all__ +
|
||||
protocols.__all__ +
|
||||
transports.__all__ +
|
||||
futures.__all__ +
|
||||
tasks.__all__ +
|
||||
|
||||
25
stdlib/3.4/asyncio/protocols.pyi
Normal file
25
stdlib/3.4/asyncio/protocols.pyi
Normal file
@@ -0,0 +1,25 @@
|
||||
from typing import AnyStr
|
||||
|
||||
__all__ = ['BaseProtocol', 'Protocol', 'DatagramProtocol',
|
||||
'SubprocessProtocol']
|
||||
|
||||
from asyncio import transports
|
||||
|
||||
class BaseProtocol:
|
||||
def connection_made(self, transport: transports.BaseTransport) -> None: ...
|
||||
def connection_lost(self, exc: Exception) -> None: ...
|
||||
def pause_writing(self) -> None: ...
|
||||
def resume_writing(self) -> None: ...
|
||||
|
||||
class Protocol(BaseProtocol):
|
||||
def data_received(self, data: AnyStr) -> None: ...
|
||||
def eof_received(self) -> bool: ...
|
||||
|
||||
class DatagramProtocol(BaseProtocol):
|
||||
def datagram_received(self, data: AnyStr, addr: str) -> None: ...
|
||||
def error_received(self, exc: Exception) -> None: ...
|
||||
|
||||
class SubprocessProtocol(BaseProtocol):
|
||||
def pipe_data_received(self, fd: int, data: AnyStr) -> None: ...
|
||||
def pipe_connection_lost(self, fd: int, exc: Exception) -> None: ...
|
||||
def process_exited(self) -> None: ...
|
||||
Reference in New Issue
Block a user