class documentation

class Fragmentation(Capability):

Constructor: Fragmentation(protocol)

View In Hierarchy

The Fragmentation capability doesn't define any incoming operation handlers, but provides methods to fragment outgoing messages

Method __init__ Undocumented
Method fragment Serializes the provided message, then splits the serialized message according to fragment_size, then sends the fragments.
Instance Variable fragmentation_seed Undocumented
Method _create_fragment Given a string fragment of the original message, creates the appropriate fragment message
Method _fragment_generator Returns a generator of fragment messages
def __init__(self, protocol):

Undocumented

def fragment(self, message, fragment_size, mid=None):

Serializes the provided message, then splits the serialized message according to fragment_size, then sends the fragments.

If the size of the message is less than the fragment size, then the original message is returned rather than a single fragment

Since fragmentation is typically only used for very large messages, this method returns a generator for fragments rather than a list

Keyword Arguments message -- the message dict object to be fragmented fragment_size -- the max size for the fragments mid -- (optional) if provided, the fragment messages will be given this id. Otherwise an id will be auto-generated.

Returns a generator of message dict objects representing the fragments

fragmentation_seed =

Undocumented

def _create_fragment(self, fragment, num, total, mid):

Given a string fragment of the original message, creates the appropriate fragment message

def _fragment_generator(self, msg, size, mid):

Returns a generator of fragment messages