mongodb-queue-0.1.0.0: a queue using MongoDB

Safe HaskellNone

Database.MongoDB.Queue

Synopsis

Documentation

work :: QueueWorker -> (Document -> Action IO ()) -> IO ()Source

Perform the action every time there is a new message. And then marks the message as handled. Does not call ForkIO, blocks the program

Do not call this multiple times against the same QueueWorker

emit :: QueueEmitter -> Document -> IO ()Source

emit a message for a worker

peek :: QueueWorker -> IO DocumentSource

used for testing. Get the next document, will not mark it as handled Do not peek/work multiple times against the same QueueWorker

createEmitter :: DBRunner -> IO QueueEmitterSource

create a QueueEmitter

createWorker :: DBRunner -> IO QueueWorkerSource

creates a QueueWorker Do not work multiple times against the same QueueWorker