b.s.p.SmartClientRequestProtocolOne(SmartProtocolBase, Requester, message.ResponseHandler) : class documentation

Part of bzrlib.smart.protocol View In Hierarchy

Known subclasses: bzrlib.smart.protocol.SmartClientRequestProtocolTwo

The client-side protocol for smart version 1.
Method __init__ Construct a SmartClientRequestProtocolOne.
Method set_headers Undocumented
Method call Make a remote call.
Method call_with_body_bytes Make a remote call of args with body bytes 'body'.
Method call_with_body_readv_array Make a remote call with a readv array.
Method call_with_body_stream Undocumented
Method cancel_read_body After expecting a body, a response code may indicate one otherwise.
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 query_version Return protocol version number of the server.
Method _read_response_tuple Undocumented
Method _raise_args_if_error Undocumented
Method _response_is_unknown_method Raise UnexpectedSmartServerResponse if the response is an 'unknonwn
Method _recv_tuple Receive a tuple from the medium request.
Method _write_args Undocumented
Method _write_protocol_version Write any prefixes this protocol requires.

Inherited from SmartProtocolBase:

Method _encode_bulk_data Encode body as a bulk data chunk.
Method _serialise_offsets Serialise a readv offset list.

Inherited from ResponseHandler:

Method read_streamed_body Returns an iterable that reads and returns a series of body chunks.
def __init__(self, request):
Construct a SmartClientRequestProtocolOne.
ParametersrequestA SmartClientMediumRequest to serialise onto and deserialise from.
def set_headers(self, headers):
Undocumented
def call(self, *args):
Make a remote call.
Parametersargsthe arguments of this call.
def call_with_body_bytes(self, args, body):
Make a remote call of args with body bytes 'body'.

After calling this, call read_response_tuple to find the result out.

def call_with_body_readv_array(self, args, body):
Make a remote call with a readv array.

The body is encoded with one line per readv offset pair. The numbers in each pair are separated by a comma, and no trailing n is emitted.

def call_with_body_stream(self, args, stream):
Undocumented
def cancel_read_body(self):
After expecting a body, a response code may indicate one otherwise.

This method lets the domain client inform the protocol that no body will be transmitted. This is a terminal method: after calling it the protocol is not able to be used further.

def _read_response_tuple(self):
Undocumented
def read_response_tuple(self, expect_body=False):
Read a response tuple from the wire.

This should only be called once.

def _raise_args_if_error(self, result_tuple):
Undocumented
def _response_is_unknown_method(self, result_tuple):
Raise UnexpectedSmartServerResponse if the response is an 'unknonwn method' response to the request.
ParametersresponseThe response from a smart client call_expecting_body call.
verbThe verb used in that call.
RaisesUnexpectedSmartServerResponse
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.

def _recv_tuple(self):
Receive a tuple from the medium request.
def query_version(self):
Return protocol version number of the server.
def _write_args(self, args):
Undocumented
def _write_protocol_version(self):
Write any prefixes this protocol requires.

Version one doesn't send protocol versions.

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