Learn R Programming

nanonext (version 0.13.2)

next_config: 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)

Value

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

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).

Examples

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

next_config(NULL)
next_config()

Run the code above in your browser using DataLab