queue R6 class, for queueing mutant jobs
Methods
Method print()
print method for queue objects
Method new()
Create a new queue object
Usage
queue$new(temporary = TRUE)Arguments
temporary(logical) create a temporary queue that is cleaned up at the end of your R session? default:
TRUE. ifFALSE, we userappdirs::user_data_dir()to cache the file. use$queue_path()to get the path for the queue
Method publish()
publish a job into the queue
Usage
queue$publish(message, title = uuid::UUIDgenerate())Arguments
message(character) job message, a JSON string with fields
pathandmutant_location, for the file path to the mutated package to test and information on the location of the mutation, respectivelytitle(character) job title, a UUID, generated from
uuid::UUIDgenerate()
Examples
if (FALSE) { # \dontrun{
x <- queue$new()
x
x$q
x$queue_path()
x$messages()
z <- list(
path = tempfile(),
mutant_location = list(
`some-file.R` =
list(line1 = 45, line2 = 46, column = 4, from = "==", to = ">")))
x$publish(as.character(jsonlite::toJSON(z)))
x
x$messages()
mssg <- x$consume()
mssg
mssg$title
mssg$message
jsonlite::fromJSON(mssg$message)
x$messages()
x$done(mssg)
x$messages()
x
} # }