Message#

class FIREQ_CLIENT.network.protocol.Message(header: dict, data: bytes = b'')[source]#

Bases: object

Simple message type, will be sent over the socket as a json.

Parameters:
  • type (str) – Message type identifier (“experiment_header” or “sweep_header”).

  • metadata (dict) – Full metadata dict to serialize as JSON.

header: dict#
data: bytes = b''#
to_buffers() → tuple[source]#

Turn the message into a tuple of bytes ready to be sent over the network.

The tuple always starts with a 4 byte length item that defines the length of the header, followed by the serialized header (using messagepack) and optionally the data bytes.

Returns:

Series of byte objects

Return type:

tuple