R6_txtq {txtq} | R Documentation |
R6 class for txtq
objects
Description
See the txtq()
function for full documentation and usage.
Methods
Public methods
Method new()
Initialize a txtq.
Usage
R6_txtq$new(path, use_lock_file = TRUE)
Arguments
path
Character string giving the file path of the queue. The
txtq()
function creates a folder at this path to store the messages.use_lock_file
Logical, whether to use a lock file for blocking operations. Should only be
FALSE
in specialized use cases with no parallel computing (for example, when atxtq
is used as a database and accessed by only one process.)
Method path()
Get the txtq path.
Usage
R6_txtq$path()
Method count()
Get the number of messages in the queue.
Usage
R6_txtq$count()
Method total()
Get the number of messages in the database.
Usage
R6_txtq$total()
Method empty()
Detect whether the txtq is empty.
Usage
R6_txtq$empty()
Method log()
List the whole database.
Usage
R6_txtq$log()
Method list()
List messages.
Usage
R6_txtq$list(n = -1)
Arguments
n
Number of messages.
Method pop()
Pop messages.
Usage
R6_txtq$pop(n = 1)
Arguments
n
Number of messages.
Method push()
Push messages.
Usage
R6_txtq$push(title, message)
Arguments
title
Titles of the messages.
message
Contents of the messages.
Method reset()
Reset the txtq.
Usage
R6_txtq$reset()
Method clean()
Clean the txtq.
Usage
R6_txtq$clean()
Method destroy()
Destroy the txtq.
Usage
R6_txtq$destroy()
Method validate()
Validate the txtq.
Usage
R6_txtq$validate()
Method import()
Import another txtq.
Usage
R6_txtq$import(queue)
Arguments
queue
External txtq to import.
Method clone()
The objects of this class are cloneable with this method.
Usage
R6_txtq$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
See Also
txtq