b.s.m.ConventionalResponseHandler(MessageHandler, ResponseHandler) : class documentation

Part of bzrlib.smart.message View In Hierarchy

No class docstring
Method __init__ Undocumented
Method setProtoAndMediumRequest Undocumented
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 read_response_tuple Read a response tuple from the wire.
Method read_body_bytes Read bytes from the body, decoding into a byte stream.
Method read_streamed_body Returns an iterable that reads and returns a series of body chunks.
Method cancel_read_body Stop expecting a body for this response.
Method _wait_for_response_args Undocumented
Method _wait_for_response_end Undocumented
Method _read_more Undocumented

Inherited from MessageHandler:

Method headers_received Called when message headers are received.
Method end_received Called when the end of the message is received.
def __init__(self):
Undocumented
def setProtoAndMediumRequest(self, protocol_decoder, medium_request):
Undocumented
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 _wait_for_response_args(self):
Undocumented
def _wait_for_response_end(self):
Undocumented
def _read_more(self):
Undocumented
def protocol_error(self, exception):
Called when there is a protocol decoding error.

The default implementation just re-raises the exception.

def read_response_tuple(self, expect_body=False):
Read a response tuple from the wire.
def read_body_bytes(self, count=-1):
Read bytes from the body, decoding into a byte stream.

We read all bytes at once to ensure we've checked the trailer for errors, and then feed the buffer back as read_body_bytes is called.

Like the builtin file.read in Python, a count of -1 (the default) means read the entire body.

def read_streamed_body(self):
Returns an iterable that reads and returns a series of body chunks.
def cancel_read_body(self):
Stop expecting a body for this response.

If expect_body was passed to read_response_tuple, this cancels that expectation (and thus finishes reading the response, allowing a new request to be issued). This is useful if a response turns out to be an error rather than a normal result with a body.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.