if(interactive()){
lapply_callr(1:3, function(x, a){
c(Sys.getpid(), a, x)
}, a = 1)
lapply_callr(1:30, function(x)
{
Sys.sleep(0.1)
sprintf("a + x = %d", a + x)
}, .globals = list(a = 1),
.callback = I, .name = "Test")
}
Run the code above in your browser using DataLab