Envelopes are the primary container used to send messages throughout the transport layer. Envelopes comprise four components, and are capped at a length of 4. At their core, envelopes are deques.
The four parts in order of porsition are: header
, meta
, pipeline
, and data
.
There are two ways to populate an envelope:
Envelope.pack(header, meta, pipeline, data)
This method requires raw python datastructs to populate. Header is a uuid
, meta is a dict
, pipeline is a dict
, and data is a list
. This method is primarily used to create new envelopes, or repack and unpacked envelope.
Envelope.load(sealed_envelope)
This method requires an pre serialized sealed_envelope, such as would arrive via a socket.
- lifespan
- length
- size
type: int
The size in bytes of the data
payload.
type: int
The number of items in the data
payload.
type: int
The number of remaining tasks in the pipeline.
- size
- length
- lifespan
- times
- stage
type: int
The size in bytes of the data
payload.
type: int
The number of items in the data
payload.
type: int
The number of remaining tasks in the pipeline.
type: dict
Holder for timing floats (not really used).
type: uuid
The serial number for the segments generated when an envelope in split up in the chunker.
- tasks
- completed
- kwargs
type: deque
The pending tasks in a pipeline.
type: deque
Holds an entry for each completed task.
type: dict
All the values required for tasks in the pipeline that are not data
.