An object of this class handles the low-level communication with
the Jupyter frontend or kernel manager. There should only be one object of this
class in existence.
Public fields
r_session
See RKernelSession
.
DAPServer
The current DAP server
Methods
Method new()
Initialize the kernel
Arguments
conn_info
A list with the connection info from the front-end
Method run()
Run the kernel.
Method poll_and_respond()
A single iteration of the kernel loop
Usage
Kernel$poll_and_respond()
Method clear_output()
Clear the current output cell in the frontend.
Usage
Kernel$clear_output(wait)
Arguments
wait
Logical value, whether to wait until output is cleared.
Method stream()
Stream text to the frontend.
Usage
Kernel$stream(text, stream)
Arguments
text
Text to be sent to the frontend
stream
A string to select the stream – either "stout" or "stderr"
Stream text to the frontend via 'stdout' stream.
Arguments
text
Text to be sent to the frontend
Stream text to the frontend via 'stderr' stream.
Arguments
text
Text to be sent to the frontend
Method r_session_msg()
Stream message created from R session process to the frontend via 'stderr' stream.
Usage
Kernel$r_session_msg(msg)
Arguments
msg
The message created by the 'RKernelSession' object.
Method execute_result()
Send execution results to the frontend
Usage
Kernel$execute_result(data, metadata = emptyNamedList)
Arguments
data
Execution result in rich format
metadata
A list with metadata
Method display_send()
Send rich format data to the frontend
Arguments
msg
A list with the appropriate structure. [TODO]
Method send_error()
Send an error message and traceback to the frontend.
Usage
Kernel$send_error(name, value, traceback)
Arguments
name
A string, the error name.
value
A string, the value of the error message.
traceback
A character vector with the traceback.
Method send_comm()
Send a message via a comm.
Arguments
msg
A list containing a comm message.
Method get_parent()
The parent of the message currently sent.
Usage
Kernel$get_parent(channel = "shell")
Arguments
channel
A string, the relevant input channel.
Method get_conn_info()
Return the current connection info.
Method is_child()
Check if the current process is a fork from the original kernel process
Send an input request to the frontend
Usage
Kernel$input_request(prompt = "", password = FALSE)
Arguments
prompt
A prompt string
password
Logical value; whether the input should be hidden like in a
password dialog
Method read_stdin()
Read a line from the frontend
Method send_debug_event()
Send a debug event to the frontend
Usage
Kernel$send_debug_event(content)
Arguments
content
A list, content provided by the debug adapter
Method clone()
The objects of this class are cloneable with this method.
Usage
Kernel$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.