I'm working on some code in R that makes heavy use of the package rpostgresql. Some of the queries I'm using take quite a while to download, so I would like to periodically show a message to the users (something like "Download in progress, please be patient..") so that it is clear that the program didn't crash.
Ideally, I'd like to write the code as an all-purpose wrapper for functions so that it will give feedback to the user along the way (download in progress, time elapsed, etc.)
For example, if we have an example function:
x<-runif(10)
I would like to make a wrapper of the form
some_wrapper_function(x<-runif(10))
where some_wrapper_function gives periodic updates while the wrapped code is running.
It seems like this requires parallel coding, but with the hitch that the clusters need to talk to each other at least once.
Any thoughts? Or is there an existing function that does this?