protocol_factory should instantiate object with Protocol interface.
pipe is file-like object already switched to nonblocking.
Return pair (transport, protocol), where transport support
- ReadTransport ABC"""
+ ReadTransport interface."""
# The reason to accept file-like object instead of just file descriptor
# is: we need to own pipe and close it at transport finishing
# Can got complicated errors if pass f.fileno(),
protocol_factory should instantiate object with BaseProtocol interface.
Pipe is file-like object already switched to nonblocking.
Return pair (transport, protocol), where transport support
- WriteTransport ABC"""
+ WriteTransport interface."""
# The reason to accept file-like object instead of just file descriptor
# is: we need to own pipe and close it at transport finishing
# Can got complicated errors if pass f.fileno(),
class BaseProtocol:
- """ABC for base protocol class.
+ """Common base class for protocol interfaces.
Usually user implements protocols that derived from BaseProtocol
like Protocol or ProcessProtocol.
class Protocol(BaseProtocol):
- """ABC representing a protocol.
+ """Interface for stream protocol.
The user should implement this interface. They can inherit from
this class but don't need to. The implementations here do
class DatagramProtocol(BaseProtocol):
- """ABC representing a datagram protocol."""
+ """Interface for datagram protocol."""
def datagram_received(self, data, addr):
"""Called when some datagram is received."""
class SubprocessProtocol(BaseProtocol):
- """ABC representing a protocol for subprocess calls."""
+ """Interface for protocol for subprocess calls."""
def pipe_data_received(self, fd, data):
"""Called when the subprocess writes data into stdout/stderr pipe.
class BaseTransport:
- """Base ABC for transports."""
+ """Base class for transports."""
def __init__(self, extra=None):
if extra is None:
class ReadTransport(BaseTransport):
- """ABC for read-only transports."""
+ """Interface for read-only transports."""
def pause_reading(self):
"""Pause the receiving end.
class WriteTransport(BaseTransport):
- """ABC for write-only transports."""
+ """Interface for write-only transports."""
def set_write_buffer_limits(self, high=None, low=None):
"""Set the high- and low-water limits for write flow control.
class Transport(ReadTransport, WriteTransport):
- """ABC representing a bidirectional transport.
+ """Interface representing a bidirectional transport.
There may be several implementations, but typically, the user does
not implement new transports; rather, the platform provides some
class DatagramTransport(BaseTransport):
- """ABC for datagram (UDP) transports."""
+ """Interface for datagram (UDP) transports."""
def sendto(self, data, addr=None):
"""Send data to the transport.