Skip to contents

[Deprecated in favour of the '.serial' argument to everywhere] Registers custom serialization and unserialization functions for reference objects. Settings apply only to the ‘default’ compute profile, and daemons must have been set beforehand.

Usage

serialization(fns, class, vec = FALSE)

Arguments

fns

either a list comprising 2 functions:
serialization function: must accept a reference object (or list of objects) inheriting from ‘class’ and return a raw vector.
unserialization function: must accept a raw vector and return a reference object (or list of reference objects).
or else NULL to reset.

class

character string of the class of object custom serialization functions are applied to, e.g. ‘ArrowTabular’ or ‘torch_tensor’.

vec

[default FALSE] whether or not the serialization functions are vectorized. If FALSE, they should accept and return reference objects individually e.g. arrow::write_to_raw and arrow::read_ipc_stream. If TRUE, they should accept and return a list of reference objects, e.g. torch::torch_serialize and torch::torch_load.

Value

Invisibly, a list comprising the currently-registered serialization configuration for the ‘default’ compute profile (an empty list if not registered).

Note

This function is deprecated and will be removed in a later package version. Use serial_config to create a configuration to pass directly to the '.serial' argument of everywhere.