Duncan,
I don't know if it is best, but you can have a look at "background"[1] which is
I believe what "later" was inspired by. It is a very minimal example so should
give you ideas on how to do that in your package - it runs the R code on the
main thread so it should be as close to safe as one
I'm updating low level stuff in the rgl package. I'm exploring using
the GLFW library to handle low level stuff instead of trying to do that
myself.
Currently rgl has fairly ugly code to link into the R event loop. (It
needs to do this so that it hears about mouse movement, etc.) I'm
hopin