This class is an interpreter for node in executable documents that contain R code.
It implements the compile
, execute
, and other core methods of Executa's
Executor
interface.
The executed node with properties such as outputs
and errors
potentially updated.
Currently only handles a single session.
See Pyla and Basha for examples of implementations of interpreters for other languages, in other languages.
envir
Environment for the session
new()
Initialize an Interpreter
instance
Interpreter$new(servers = list(StdioServer$new()))
servers
List of servers for the interpreter
manifest()
Get the manifest for the interpreter.
The manifest describes the capabilities and addresses of an executor so that peers know how to delegate method calls to this interpreter.
Interpreter$manifest(then)
then
A function to call with the result
execute()
Execute a node.
Interpreter$execute(node, job, then, ...)
node
The node to execute. Usually, a CodeChunk
.
job
The job id.
then
A function to call with the result
...
Currently other arguments e.g. session
are ignored.
dispatch()
Dispatch a call to one of the interpreter's methods
Interpreter$dispatch(method, params, then, catch)
method
The name of the method
params
A list of parameter values (i.e. arguments)
then
A function to call with the result
catch
A function to call with any error
register()
Register this interpreter on this machine.
Creates a manifest file for the interpreter so that it can be used as a peer by other executors.
Interpreter$register()
start()
Start serving the interpreter
Interpreter$start(background = -1)
background
Run the server in the background with this duration, in seconds,
stop()
Stop serving the interpreter
Interpreter$stop()
clone()
The objects of this class are cloneable with this method.
Interpreter$clone(deep = FALSE)
deep
Whether to make a deep clone.