Class Comm
A message-oriented communication object, representing an established
Declaration
class Comm(ABC)
source linkDocumentation
communication channel. There should be only one reader and one
writer at a time: to manage current communications, even with a
single peer, you must create distinct ``Comm`` objects.
Messages are arbitrary Python objects. Concrete implementations
of this class can implement different serialization mechanisms
depending on the underlying transport's characteristics.
Methods
Overrides
This method is overriden in:
▶ def abort(self) @abstractmethod Close the communication immediately and abruptly. Useful in destructors or generators' ``finally`` blocks.
@abstractmethod
def abort(self)
Overrides
This method is overriden in:
▶ def close(self) @abstractmethod Close the communication cleanly. This will attempt to flush outgoing buffers before actually closing the underlying transport.
@abstractmethod
def close(self)
This method is a coroutine.
Overrides
This method is overriden in:
▶ def closed(self) @abstractmethod Return whether the stream is closed.
@abstractmethod
def closed(self)
Overrides
This method is overriden in:
▶ def extra_info(self) @property Return backend-specific information about the communication, as a dict. Typically, this is information which is initialized when the communication is established and doesn't vary afterwards.
▶ def local_address(self) @abstractproperty The local address. For logging and debugging purposes only.
@abstractproperty
def local_address(self)
Overrides
This method is overriden in:
▶ def peer_address(self) @abstractproperty The peer's address. For logging and debugging purposes only.
@abstractproperty
def peer_address(self)
Overrides
This method is overriden in:
▶ def read(self, deserializers=None) @abstractmethod Read and return a message (a Python object).
@abstractmethod
def read(
self,
deserializers=None,
)
This method is a coroutine.
Parameters
Overrides
This method is overriden in:
▶ def write(self, msg, serializers=None, on_error=None) @abstractmethod Write a message (a Python object).
@abstractmethod
def write(
self,
msg,
serializers=None,
on_error=None,
)
This method is a coroutine.
Parameters
Overrides
This method is overriden in:
Class methods
@staticmethod
def handshake_configuration(
local,
remote,
)
@staticmethod
def handshake_info()
Subclasses
Reexports