Skip to contents

Create an R6 object to manage local asynchronous quick tasks with error detection.

Usage

crew_async(workers = NULL)

Arguments

workers

Number of local mirai daemons to run asynchronous tasks. If NULL, then tasks will be evaluated synchronously.

Value

An R6 async client object.

Details

crew_async() objects are created inside launchers to allow launcher plugins to run local tasks asynchronously, such as calls to cloud APIs to launch serious remote workers.

See also

Other async: crew_class_async

Examples

if (identical(Sys.getenv("CREW_EXAMPLES"), "true")) {
x <- crew_async()
x$start()
out <- x$eval(1 + 1)
mirai::call_mirai_(out)
out$data # 2
x$terminate()
}