Skip to content

Use embedded R for better management including timestamped output #243

Open

Description

@yogat3ch

Original thread on {shinytest2} for context.
Can there be an option to toggle timestamping of output from stderr (and also stdout) for a processx background r process via r_bg?

Activity

  1. gaborcsardi commented on Jan 10, 2023

    @gaborcsardi
    Member

    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.

  2. yogat3ch commented on Jan 10, 2023

    @yogat3ch
    Author

    @schloerke It sounds like a rework of shinytest2 to use callr would be necessary, is that a substantial undertaking?

  3. schloerke commented on Jan 10, 2023

    @schloerke

    {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.

  4. gaborcsardi commented on Jan 10, 2023

    @gaborcsardi
    Member

    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.

  5. schloerke commented on Jan 10, 2023

    @schloerke

    Sounds good. I look forward to the upcoming feature in {callr}. Thank you!

  6. transferred this issue fromr-lib/processxon Jan 10, 2023
  7. yogat3ch commented on Jan 10, 2023

    @yogat3ch
    Author

    Awesome, appreciative of the discussion and look forward to the forthcoming callr features!

  8. added
    feature
    on Oct 31, 2023
  9. changed the title [-]Feature request: Capture all R Console output with timestamp?[/-] [+]Use embedded R for better management including timestamped output[/+] on May 17, 2026
  10. gaborcsardi commented on Jun 4, 2026

    @gaborcsardi
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions