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.

Value

The executed node with properties such as outputs and errors potentially updated.

Details

Currently only handles a single session.

See Pyla and Basha for examples of implementations of interpreters for other languages, in other languages.

Public fields

envir

Environment for the session

Methods

Public methods


Method new()

Initialize an Interpreter instance

Usage

Interpreter$new(servers = list(StdioServer$new()))

Arguments

servers

List of servers for the interpreter


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

Usage

Interpreter$manifest(then)

Arguments

then

A function to call with the result


Method execute()

Execute a node.

Usage

Interpreter$execute(node, job, then, ...)

Arguments

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.


Method dispatch()

Dispatch a call to one of the interpreter's methods

Usage

Interpreter$dispatch(method, params, then, catch)

Arguments

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


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

Usage

Interpreter$register()


Method start()

Start serving the interpreter

Usage

Interpreter$start(background = -1)

Arguments

background

Run the server in the background with this duration, in seconds,


Method stop()

Stop serving the interpreter

Usage

Interpreter$stop()


Method clone()

The objects of this class are cloneable with this method.

Usage

Interpreter$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.