b.s.m.MessageHandler(object) : class documentation

Part of bzrlib.smart.message View In Hierarchy

Known subclasses: bzrlib.smart.message.ConventionalRequestHandler, bzrlib.smart.message.ConventionalResponseHandler

Base class for handling messages received via the smart protocol.

As parts of a message are received, the corresponding PART_received method will be called.

Method __init__ Undocumented
Method headers_received Called when message headers are received.
Method byte_part_received Called when a 'byte' part is received.
Method bytes_part_received Called when a 'bytes' part is received.
Method structure_part_received Called when a 'structure' part is received.
Method protocol_error Called when there is a protocol decoding error.
Method end_received Called when the end of the message is received.
def __init__(self):
Undocumented
def headers_received(self, headers):
Called when message headers are received.

This default implementation just stores them in self.headers.

def byte_part_received(self, byte):
Called when a 'byte' part is received.

Note that a 'byte' part is a message part consisting of exactly one byte.

def bytes_part_received(self, bytes):
Called when a 'bytes' part is received.

A 'bytes' message part can contain any number of bytes. It should not be confused with a 'byte' part, which is always a single byte.

def structure_part_received(self, structure):
Called when a 'structure' part is received.
Parametersstructuresome structured data, which will be some combination of list, dict, int, and str objects.
def protocol_error(self, exception):
Called when there is a protocol decoding error.

The default implementation just re-raises the exception.

def end_received(self):
Called when the end of the message is received.
API Documentation for Bazaar, generated by pydoctor at 2019-11-23 00:41:47.