Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rdpeng/queue

Simple On-Disk Queue in R
https://github.com/rdpeng/queue

Last synced: 3 months ago
JSON representation

Simple On-Disk Queue in R

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

# queue

The goal of queue is to provide a simple on-disk queue data structure in R.

## Installation

You can install queue from github with:

```{r gh-installation, eval = FALSE}
# install.packages("remotes")
remotes::install_github("rdpeng/queue")
```

## Example

This is a basic example which shows you how to solve a common problem:

```{r example}
library(queue)
x <- create_queue("myqueue")
is_empty(x)

## Queue up some items
enqueue(x, 1)
enqueue(x, 2)

## Look at the head of the queue
peek(x)

## Retrieve some items
dequeue(x)
dequeue(x)

is_empty(x)
delete_queue(x)
```