I'm trying to set up an asynchronous system() call in R. In order for this to be useful, the user needs a way to check whether the process has ended. The question is how to test for that? In how to run an executable file and then later kill or terminate the same process with R in Windows the suggestion seems to be to capture all pid's before and after the system() call in order to get the pid of the just-launched process (which can then be used to test whether it has ended), but this seems like an error prone way of doing it, on top of it being OS dependant...
Is there other approaches to this problem (doesn't have to involve pid's)
edit: The current scenario this should be used in:
I'm developing a Shiny GUI that handles potentially very long running calculations that are implemented in Java. The calculations are done in batches, and during these runs, even though R is idle, the GUI is locked from interacting with the R server as it is waiting for the Java process to finish. I want a way to initiate the Java process and not wait for it to finish (using the wait=FALSE parameter), but have a fail-safe way of checking that it has completed, so the GUI can be updated accordingly...