mongodb-queue-0.3: message queue using MongoDB

Safe HaskellNone




emit :: (MonadIO m, Applicative m) => QueueEmitter -> Document -> Action m ()Source

emit a message for a worker

nextFromQueue :: (MonadIO m, MonadBaseControl IO m) => QueueWorker -> Action m DocumentSource

Get the next message from the queue. First marks the message as handled.

Do not call this from multiple threads against the same QueueWorker

createEmitter :: (Applicative m, MonadIO m) => Action m QueueEmitterSource

create a QueueEmitter

mkEmitter :: (Applicative m, MonadIO m) => EmitterOpts -> Action m QueueEmitterSource

create an emitter with non-default configuration

createWorker :: (MonadIO m, Applicative m) => Action m QueueWorkerSource

creates a QueueWorker create a single QueueWorker per process (per queue collection) call nextFromQueue with the QueueWorker to get the next message

QueueWorker is probably poorly named now with the direction the library has taken. To handle multiple messages at once use the setup mentioned above with just 1 QueueWorker. But immediately hand off messages from nextFromQueue to worker threads (this library does not help you create worker threads)

mkWorker :: (MonadIO m, Applicative m) => WorkerOpts -> Action m QueueWorkerSource

create an worker with non-default configuration