Skip to contents

R6 class for async configuration.

Details

See crew_async().

See also

Other async: crew_async()

Active bindings

workers

See crew_async().

instance

Name of the current instance.

Methods


Method new()

TLS configuration constructor.

Usage

crew_class_async$new(workers = NULL)

Arguments

workers

Argument passed from crew_async().

Returns

An R6 object with TLS configuration.


Method validate()

Validate the object.

Usage

crew_class_async$validate()

Returns

NULL (invisibly).


Method start()

Start the local workers and error handling socket.

Usage

crew_class_async$start()

Details

Does not create workers or an error handling socket if workers is NULL or the object is already started.

Returns

NULL (invisibly).


Method terminate()

Start the local workers and error handling socket.

Usage

crew_class_async$terminate()

Details

Waits for existing tasks to complete first.

Returns

NULL (invisibly).


Method started()

Show whether the object is started.

Usage

crew_class_async$started()

Returns

Logical of length 1, whether the object is started.


Method asynchronous()

Show whether the object is asynchronous (has real workers).

Usage

crew_class_async$asynchronous()

Returns

Logical of length 1, whether the object is asynchronous.


Method eval()

Run a local asynchronous task using a local compute profile.

Usage

crew_class_async$eval(
  command,
  substitute = TRUE,
  data = list(),
  packages = character(0L),
  library = NULL
)

Arguments

command

R code to run.

substitute

Logical of length 1, whether to substitute command. If FALSE, then command must be an expression object or language object.

data

Named list of data objects required to run command.

packages

Character vector of packages to load.

library

Character vector of library paths to load the packages from.

Details

Used for launcher plugins with asynchronous launches and terminations. If processes is NULL, the task will run locally. Otherwise, the task will run on a local process in the local mirai compute profile.

Returns

If the processes field is NULL, a list with an object named data containing the result of evaluating expr synchronously. Otherwise, the task is evaluated asynchronously, and the result is a mirai task object. Either way, the data element of the return value will contain the result of the task.