Serialisation

mosaic.comms.serialisation.serialise(data)[source]

Serialise data using Pickle protocol 5 as a default and, failing that, resort to cloudpickle.

Parameters:

data (object)

Returns:

  • bytes – Pickled object, in-band.

  • list – List of zero-copy buffers, out-of-band.

mosaic.comms.serialisation.deserialise(in_band, out_band)[source]

Deserialise using Pickle protocol 5.

Parameters:
  • in_band (bytes) – Pickled object.

  • out_band (list) – List of buffers.

Return type:

deserialised object