Open yogat3ch opened 1 year ago
That is not possible for processx, but it is possible to callr. In fact, it is basically already implemented in the asciicast package, which creates a JSON file with time stamps.
@schloerke It sounds like a rework of shinytest2
to use callr
would be necessary, is that a substantial undertaking?
{shinytest2}
already uses {callr}
, so no problem there.
I hope I'm not missing something obvious, but I don't see any usage (other than within testing code) of {callr}
within {asciicast}
.
I do see multiple usages of processx::poll(list(con))
inside a while loop. I believe this would block the main R session which we can't have for testing or interactive use within the terminal. For {asciicast}
, you're allowed to block the main R session while the function call is performing the replay.
asciicast does not use callr, it is an alternative. It uses an embedded R in a subprocess instead of running the usual R executable from the terminal, which allows a lot more control.
So you cannot substitute callr with asciicast. But the same mechanism that is in asciicast is coming to callr soonish, and then you can have timestamps in the output.
Sounds good. I look forward to the upcoming feature in {callr}
. Thank you!
Awesome, appreciative of the discussion and look forward to the forthcoming callr
features!
Original thread on
{shinytest2}
for context. Can there be an option to toggle timestamping of output from stderr (and also stdout) for aprocessx
background r process viar_bg
?