b.s.protocol : module documentation

Part of bzrlib.smart

Wire-level encoding and decoding of requests and responses for the smart client and server.
Class Requester Abstract base class for an object that can issue requests on a smart
Class SmartProtocolBase Methods common to client and server
Class SmartServerRequestProtocolOne Server-side encoding and decoding logic for smart version 1.
Class SmartServerRequestProtocolTwo Version two of the server side of the smart protocol.
Class ChunkedBodyDecoder Decoder for chunked body data.
Class LengthPrefixedBodyDecoder Decodes the length-prefixed bulk data.
Class SmartClientRequestProtocolOne The client-side protocol for smart version 1.
Class SmartClientRequestProtocolTwo Version two of the client side of the smart protocol.
Function build_server_protocol_three Undocumented
Class ProtocolThreeDecoder Undocumented
Class ProtocolThreeResponder Undocumented
Class ProtocolThreeRequester No class docstring; 2/6 methods documented
Function _recv_tuple Undocumented
Function _decode_tuple Undocumented
Function _encode_tuple Encode the tuple args to a bytestream.
Function _send_stream Undocumented
Function _send_chunks Undocumented
Class _NeedMoreBytes Raise this inside a _StatefulDecoder to stop decoding until more bytes
Class _StatefulDecoder Base class for writing state machines to decode byte streams.
Class _ProtocolThreeEncoder No class docstring; 1/13 methods documented
Function _iter_with_errors Handle errors from iterable.next().
def _recv_tuple(from_file):
Undocumented
def _decode_tuple(req_line):
Undocumented
def _encode_tuple(args):
Encode the tuple args to a bytestream.
def _send_stream(stream, write_func):
Undocumented
def _send_chunks(stream, write_func):
Undocumented
def build_server_protocol_three(backing_transport, write_func, root_client_path, jail_root=None):
Undocumented
def _iter_with_errors(iterable):
Handle errors from iterable.next().

Use like:

for exc_info, value in _iter_with_errors(iterable):
    ...

This is a safer alternative to:

try:
    for value in iterable:
       ...
except:
    ...

Because the latter will catch errors from the for-loop body, not just iterable.next()

If an error occurs, exc_info will be a exc_info tuple, and the generator will terminate. Otherwise exc_info will be None, and value will be the value from iterable.next(). Note that KeyboardInterrupt and SystemExit will not be itercepted.

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