next_configR Documentation

Configure Next Mode

Description

Configures send mode 'next' by registering functions for custom serialization and unserialization of external pointer reference objects, allowing these to be sent and received between different R sessions.

Usage

next_config(refhook = list(), mark = FALSE)

Arguments

refhook

either a list or pairlist of two functions: the signature for the first must accept a list of external pointer objects and return a raw vector, e.g. torch::torch_serialize, and the second must accept a raw vector and return a list of external pointer objects, e.g. torch::torch_load,
or else NULL to reset.

mark

[default FALSE] (for advanced use only) logical value, whether to mark serialized data with a special bit.

Details

Calling this function without any arguments returns the pairlist of currently-registered 'refhook' functions (and resets 'mark' to FALSE).

Value

A pairlist comprising the currently-registered 'refhook' functions.

Examples

g <- next_config(refhook = list(function(x) serialize(x, NULL), unserialize))
next_config()
next_config(g, mark = TRUE)

next_config(NULL)
next_config()