if (juliaSetupOk()) {
Sys.setenv("JULIA_NUM_THREADS" = parallel::detectCores())
startJuliaServer()
library(future)
plan(multisession) # use background R processes on the same machine
juliaEval("global x = 1")
# Child processes now use the same Julia session:
f1 <- future({juliaEval("x")})
value(f1)
plan(sequential) # close background workers
}
# \dontshow{
JuliaConnectoR:::stopJulia()
# }
Run the code above in your browser using DataLab