fetchNextMessage | R Documentation |
Searchers through the messages for the first unprocessed message. Return NULL
if none is found.
fetchNextMessage(queue)
## S4 method for signature 'MessageQueue'
fetchNextMessage(queue)
queue |
The |
The ListQueue
message iterates through its internal collection
until it finds an unprocessed message, or it runs out of messages.
The MongoQueue
message searches the collection.
Either an object of class P4Message
or
NULL
if there are no remaining unprocessed messages.
The ListQueue
method returns the current message if it has not
been processed. Otherwise, it increments to pointer until if either
finds an unprocessed messages or runs out of messages.
The MongoQueue
method sorts the unprocessed messages by
timestamp, and returns the one with the earliest message.
In both cases, markAsProcessed
must be called on the
processed message to advance the queue.
Russell Almond
MessageQueue
, markAsProcessed
,
resetProcessedMessages
messy <- list(
P4Message("test","Test 1","Tester","Test Message"),
P4Message("test","Test 2","Tester","Test Message",processed=TRUE),
P4Message("test","Test 3","Tester","Test Message"))
messq <- new("ListQueue","Qtest",messy)
mess1 <- fetchNextMessage(messq)
mess1
fetchNextMessage(messq)
markAsProcessed(messq,mess1)
mess2 <- fetchNextMessage(messq)
mess2
markAsProcessed(messq,mess2)
mess3 <- fetchNextMessage(messq)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.