serialization {mirai} | R Documentation |
Registers custom serialization and unserialization functions for sending and receiving external pointer reference objects.
serialization(refhook = list(), class = "", vec = FALSE)
refhook |
either a list or pairlist of two functions: the
signature for the first must accept a reference object inheriting from
'class' (or a list of such objects) and return a raw vector, and the
second must accept a raw vector and return reference objects (or a list
of such objects), |
class |
[default ""] a character string representing the class of object that these serialization function will be applied to, e.g. 'ArrowTabular' or 'torch_tensor'. |
vec |
[default FALSE] the serialization functions accept and return
reference object individually e.g. |
Calling without any arguments returns the pairlist of currently-registered 'refhook' functions.
This function may be called prior to or after setting daemons, with the registered functions applying across all compute profiles.
Invisibly, the pairlist of currently-registered 'refhook' functions. A message is printed to the console when functions are successfully registered or reset.
r <- serialization(list(function(x) serialize(x, NULL), unserialize))
print(serialization())
serialization(r)
serialization(NULL)
print(serialization())