liteq: Lightweight Portable Message Queue Using 'SQLite'

Description Examples

Description

Message queues for R. Built on top of 'SQLite' databases.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# We don't run this, because it write to the cache directory
## Not run: 
db <- tempfile()
q <- ensure_queue("jobs", db = db)
q
list_queues(db)

# Publish two messages
publish(q, title = "First message", message = "Hello world!")
publish(q, title = "Second message", message = "Hello again!")
list_messages(q)

# Consume one
msg <- try_consume(q)
msg

ack(msg)
list_messages(q)
msg2 <- try_consume(q)
nack(msg2)
list_messages(q)

# No more messages
try_consume(q)

## End(Not run)

r-lib/liteq documentation built on Dec. 18, 2017, 9:12 a.m.