Skip to content

Commit 80e9a66

Browse files
committed
Clean example a little
1 parent 1931d8f commit 80e9a66

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

inst/demos/queueDemo.R

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
## Initial version by Iñaki Ucar using Redux
22
## Adapted to RcppRedis by Dirk Eddelbuettel
33

4-
## -- quick test
5-
## redis <- new(Redis)
6-
## redis$lpush("foo", "banana")
7-
## redis$lpush("foo", "banana")
8-
## ##redis$lpop("foo")
9-
## ##redis$lpop("foo")
10-
## redis$lrem("foo", 1, "banana") # not removed
11-
## redis$lpop("foo")
12-
## redis$lpop("foo")
13-
## q()
14-
154
useRcppRedis <- function() {
165

176
ensure_queue <- function(name) {
@@ -140,5 +129,18 @@ useRedux <- function() {
140129

141130
}
142131

132+
quickCheck <- function() {
133+
redis <- new(RcppRedis::Redis)
134+
redis$lpush("foo", "banana")
135+
redis$lpush("foo", "banana")
136+
print(str(redis$lrange("foo", 0, -1)))
137+
redis$lrem("foo", 1, "banana")
138+
print(str(redis$lrange("foo", 0, -1)))
139+
redis$lpop("foo")
140+
print(str(redis$lrange("foo", 0, -1)))
141+
invisible(NULL)
142+
}
143+
143144
useRcppRedis()
144145
#useRedux()
146+
#quickCheck()

0 commit comments

Comments
 (0)