This R6 Class provides for bidirectional communication between the R Kernel and the Jupyter frontend, e.g. a Jupyter notebook

Comm(...)

Arguments

...

Arguments passed to the inializer

Details

Objects of this class are used to communicate to the frontend via custom messages.

Functions

  • Comm(): A constructor function for objects of class "CommClass"

Public fields

id

A character string, the comm id

target_name

A character string, the target

handlers

A list of handler functions

data

A list of data

Methods


Method new()

Initialize a 'Comm' object

Usage

CommClass$new(
  target_name,
  id = uuid(),
  kernel = get_current_kernel(),
  handlers = list()
)

Arguments

target_name

A string, the name of the target

id

A string, the comm id

kernel

The relevant kernel

handlers

A list of handler functions


Method open()

Open a comm

Usage

CommClass$open(data, metadata = emptyNamedList, buffers = NULL)

Arguments

data

A named list

metadata

A named list

buffers

A list of raw vectors or NULL


Method send()

Send data through a comm

Usage

CommClass$send(data, metadata = emptyNamedList, buffers = NULL)

Arguments

data

A named list

metadata

A named list

buffers

A list of raw vectors or NULL


Method close()

Close a comm

Usage

CommClass$close(
  data = emptyNamedList,
  metadata = emptyNamedList,
  buffers = NULL
)

Arguments

data

A named list

metadata

A named list

buffers

A list of raw vectors or NULL


Method clone()

The objects of this class are cloneable with this method.

Usage

CommClass$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.