| Title: | A Simple Task Queue |
|---|---|
| Description: | A task queue is provided with simple operator modeled after existing task queue functionality. By relying on either Redis or Valkey as a backend, a suitable degree of concurrency of worker nodes is provided. |
| Authors: | Dirk Eddelbuettel [aut, cre] |
| Maintainer: | Dirk Eddelbuettel <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.0.1 |
| Built: | 2026-05-21 09:35:59 UTC |
| Source: | https://github.com/eddelbuettel/tinyqueue |
A task queue is provided with simple operator modeled after existing task queue functionality. By relying on either Redis or Valkey as a backend, a suitable degree of concurrency of worker nodes is provided.
Index of help topics:
simpletask simpletask: A Simple Task Object tinyqueue tinyqueue: A Simple Workqueue Object tinyqueue-package A Simple Task Queue
Dirk Eddelbuettel <[email protected]>
Dirk Eddelbuettel [aut, cre]
Represent a simpletask object suitable for queuing
simpletask(pkg, ver, ...) ## Default S3 method: simpletask(pkg, ver, ...) ## S3 method for class 'simpletask' format(x, ...) ## S3 method for class 'simpletask' print(x, ...) enqueue_task(q, st) start_task(q) end_task(q, st, res)simpletask(pkg, ver, ...) ## Default S3 method: simpletask(pkg, ver, ...) ## S3 method for class 'simpletask' format(x, ...) ## S3 method for class 'simpletask' print(x, ...) enqueue_task(q, st) start_task(q) end_task(q, st, res)
pkg |
character A package name |
ver |
character A package version number |
... |
dots Currently ignored |
x |
simpletask A task object |
q |
tinyqueue A |
st |
object An R object describing the task that is serialized |
res |
numeric The result code of the completed task, must be between 0 and 2 |
A simpletask objects describes a task, here usually a package name
for a package to be tested along with a version number. It can be any R object
as the simplequeue serializes and de-serializes the object apropriately
tinyqueue
Create a tinyqueue object
tinyqueue(name, ...) ## Default S3 method: tinyqueue(name, ...) ## S3 method for class 'tinyqueue' print(x, ...) ## S3 method for class 'tinyqueue' format(x, ...) ## S3 method for class 'tinyqueue' summary(object, ...) ensure_queue(name) publish(queue, message) list_messages(queue) try_consume(queue) ack(queue, message, res = 0) cleanup(queue)tinyqueue(name, ...) ## Default S3 method: tinyqueue(name, ...) ## S3 method for class 'tinyqueue' print(x, ...) ## S3 method for class 'tinyqueue' format(x, ...) ## S3 method for class 'tinyqueue' summary(object, ...) ensure_queue(name) publish(queue, message) list_messages(queue) try_consume(queue) ack(queue, message, res = 0) cleanup(queue)
name |
character The task name for the queue |
... |
other arguments |
x |
tinyqueue A |
object |
tinyqueue A tinyqueue object |
queue |
tinyqueue A |
message |
object A R object describing a task that is serialized |
res |
numeric The task result that is acknowledged where default is zero for success, one signals failure, and two that the task was skipped |
A tinyqueue object manages a job queue for a given and named task,
using either Redis or Valkey as a backend. The (basic)
functionality is modelled after the liteq package.
A tinyqueue is created and returned by function ensure_queue.
The function publish_queue, try_consume and ack serve
to, respectively, enqueue a task, dequeue it in order to do the designated
work and then acknowledge completion. list_message reports the
status, and cleanup finalize and cleans up.
The tinyqueue object has several associated methods to print,
summarize, or format the object.
The functionality takes advantage of package RcppRedis and its
ability to process arbitrary R objects. This allows task descriptions
to be data.frame or list objects as needed by the application.
For the same reason, no ‘schema’ or alike has to be created as the
queued task objects are self-sufficient as R objects.
# This requires Redis or Valkey to run ## Not run: tinyqueue("sometask")# This requires Redis or Valkey to run ## Not run: tinyqueue("sometask")