You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Create temporary future for a specific backend, but don't launch it
427
-
makeFuture<- plan("next")
428
-
if (debug) mdebug("- Future backend: ", commaq(class(makeFuture)))
427
+
evaluator<- plan("next")
428
+
if (debug) mdebug("- Future backend: ", commaq(class(evaluator)))
429
429
430
430
## Implements a FutureBackend?
431
-
backend<- attr(makeFuture, "backend")
432
-
if (is.function(backend)) {
433
-
if (debug) mdebug("Using FutureBackend ...")
434
-
mdebug("- state: ", sQuote(future[["state"]]))
435
-
on.exit(mdebug("run() for ", sQuote(class(future)[1]), " ... done"), add=TRUE)
436
-
437
-
if (debug) mprint(backend)
438
-
439
-
## Apply future plan tweaks
440
-
args<- attr(makeFuture, "tweaks")
441
-
if (is.null(args)) args<-list()
442
-
443
-
args2<- formals(makeFuture)
444
-
args2$`...`<-NULL
445
-
args2$envir<-NULL
446
-
args2$lazy<-NULL## bc multisession; should be removed
447
-
448
-
for (namein names(args2)) {
449
-
args[[name]] <-args2[[name]]
450
-
}
451
-
backend<- do.call(backend, args=args)
452
-
if (debug) mdebug(" - FutureBackend: ", commaq(class(backend)))
431
+
backend<- makeFutureBackend(evaluator)
432
+
if (!is.null(backend)) {
453
433
if (!inherits(backend, "FutureBackend")) {
454
-
stop(sprintf("[INTERNAL ERROR] run.Future(): the 'backend' generated for the %s object is not a FutureBackend object: %s", class(makeFuture)[1], class(backend)[1]))
434
+
stop(sprintf("[INTERNAL ERROR] run.Future(): the 'backend' generated for the %s object is not a FutureBackend object: %s", class(evaluator)[1], class(backend)[1]))
0 commit comments