lbartnik / subprocess

Other
49 stars 10 forks source link

Refer to subprocess after R session restart #43

Closed Tazovsky closed 6 years ago

Tazovsky commented 7 years ago

I'm looking for solution to create async process in shiny application and after application restart/close be able to check if process is still running/finished, etc. - that's why I did simple experiment:


# save 
save(handle, file = "/src/dev/subprocess/handle.RData")
# load after session restart
load("/src/dev/subprocess/handle.RData")
subprocess::process_state(handle)
Error in subprocess::process_state(handle) : external C pointer is NULL```

So my question is: is there any possibility to do this using `subprocess` package?
lbartnik commented 7 years ago

Hi, I'm afraid this is not straightforward. It seems that restart/close means actually restarting R. Am I right? In that case, the child process is lost and there's no way to obtain its handle after the restart. You would need to find a way to keep the R process running regardless of what happens when the shiny app.

bedantaguru commented 6 years ago

It is not possible by the very definition of the package. as @lbartnik said if you want to keep it alive you need to keep the session active.

lbartnik commented 6 years ago

Closing at the original issuer did not respond.