sized_queue: Queue with size limit.

Description Usage Arguments Examples

Description

If you push more elements onto the queue than it has room for, they will fall off screaming and wailing.

Usage

1

Arguments

size

integer. Maximum number of elements in the queue.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
  q <- sized_queue(size = 2)
  q$push(1)
  q$get(1) # 1
  q$get(2) # NULL
  q$push(2)
  q$get(1) # 2
  q$get(2) # 1
  q$push(3)
  q$get(1) # 3
  q$get(2) # 2
  q$get(3) # NULL

## End(Not run)

syberia/director documentation built on May 30, 2019, 10:40 p.m.