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 |
Undocumented |
Method | _create |
Given a string fragment of the original message, creates the appropriate fragment message |
Method | _fragment |
Returns a generator of fragment messages |
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