cleanMessageQueue | R Documentation |
Often a queue will contain a number of messages which do not get processed. This function
cleans out messages from the queue. This is typically called both
before (called “cleaning”) importing new messages (see
importMessages
) and after (called “purging”).
cleanMessageQueue(queue, query)
## S4 method for signature 'MongoQueue'
cleanMessageQueue(queue, query)
queue |
An object of class |
query |
A list which forms a Mongo query for
selecting the messages to be removed. See
|
Return value is undefined. Called for its side effects (removing messages from database collection).
Will log and throw database errors.
Generates log entries using 'futile.logger'.
Currently no method for 'ListQueue' objects.
Russell Almond
MongoQueue
mq <- new("MongoQueue","QueueTest",mongo::MongoDB("Messages",noMongo=TRUE),
builder=buildMessage)
## Remove Fred's messages from the database.
cleanMessageQueue(mq,list(c(uid="Fred")))
## Purge NO-OP messages from the imported data.
cleanMessageQueue(mq,list(c(mess="NO-OP")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.