> Rather, non-interactive R does not run an event loop. The usual way
> around this is to use a pty, as R run from a pty is considered to be
> interactive.
>
> (Whether a fifo and a named pipe are the same concept is moot: some OSes
> have one and not the other.)
>
> The plan is to use threads in due course to handle X11 events.
>
I agree threads is the way to go.
In the meantime, I also tried a looping server which doesn't block on reads to
a pipe. This still doesn't refresh the display but if R has a command to
refresh the display then that will probably solve the problem.
# based on http://tolstoy.newcastle.edu.au/R/help/01c/2886.html
stream <- fifo("R_pipe", "r", blocking=FALSE,)
repeat
{
a <- readLines(stream)
if(length(a) != 0)
{
e <- try(eval(parse(text = a)))
if (inherits(e, "try-error"))
{
# error handling code here
cat("Error", "\n")
}
}
}
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.