MongoQueue-class | R Documentation |
"MongoQueue"
This is a message queue implemented as a database collection.
This wraps a collection in a Mongo (or other JSON-based) database.
The fetchNextMessage
looks for the first (earliest
timestamp) message which is not processed.
Class "MessageQueue"
, directly.
All reference classes extend and inherit methods from
"envRefClass"
.
signature(queue = "MongoQueue")
:
Removes messages matching query from queue.
signature(queue = "MessageQueue")
:
Returns the next unprocessed message from the Queue, or 'NULL' if
there are no processed messages in the queue.
signature(queue = "MongoQueue")
:
Imports messages into a queue from a file.
signature(col = "MongoQueue", mess =
"ANY")
: Marks a message as an error, and saves error message in
queue.
signature(col = "MongoQueue", mess =
"ANY")
: Marks a message as processed.
signature(queue =
"MongoQueue")
: Clears the processed flag for messages matching
the query.
app
:Object of class character
giving the
identifier of the application. This is used to restrict the
app
field of the message to match the current
application.
messDB
:Object of class
JSONDB
that provides a
reference to the database collection storing the messages.
builder
:Object of class function
which is used
to reconstruct the messages from the data, see
buildMessage()
and getOneRec()
.
$queue()
:Returns the JSONDB
reference.
$initialize(app, messDB, builder, ...)
:Constructor.
$fetchNextMessage()
:Internal implementation of the fetch method.
$buildIndex()
:This method builds an index in the collection. Generally only needs to be done once.
$count()
:Returns the number of unprocessed messages remaining in queue.
It is probably a good idea to build an index on this database using
the “processed” and “timestamp” fields. The
$buildIndex()
method does this.
Russell Almond
MessageQueue
,P4Message
,
MongoDB
,
fetchNextMessage()
,
cleanMessageQueue()
,
importMessages()
,
markAsProcessed()
,
resetProcessedMessages()
,
buildMessage()
,
getOneRec()
showClass("MongoQueue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.