Learn R Programming

asciicast (version 1.0.0)

asciicast_start_process: Start an asciicast background process

Description

This is for expert use, if you want to run multiple recordings in the same process.

Usage

asciicast_start_process(
  timeout = 10,
  allow_errors = TRUE,
  startup = NULL,
  record_env = NULL,
  echo = TRUE
)

Arguments

timeout

Idle timeout, in seconds If the R subprocess running the recording does not answer within this limit, it is killed and the recording stops. Update this for slow running code, that produces no output as it runs.

allow_errors

Whether to cast errors properly. If this is set to TRUE, then asciicast overwrites the "error" option. Only change this if you know what you are doing.

startup

Quoted language object to run in the subprocess before starting the recording.

record_env

Environment variables to set for the R subprocess.

echo

Whether to echo the input to the terminal. If FALSE, then only the output is shown.

Value

The R process, a processx::process object.

See Also

Other asciicast functions: asciicast-package, read_cast(), record(), write_json()

Examples

Run this code
# NOT RUN {
# Use the same R process to record multiple casts
process <- asciicast_start_process()
script1 <- "a <- runif(10)\n"
script2 <- "a\n"
cast1 <- record(textConnection(script1), process = process)
cast2 <- record(textConnection(script2), process = process)
cast1
cast2
# }

Run the code above in your browser using DataLab