This module utilizes PostgreSQL to implement a durable queue for efficently processing payloads.
Typically a producer would enqueue a new payload as part of larger database transaction
createAccount userRecord = transaction Serializable Write $ do createUser userRecord enqueue "queue_channel" emailEncoder [makeVerificationEmail userRecord]
In another thread or process the consumer would drain the queue.
-- Wait for a single new record and try to send the email 5 times for giving -- up and marking the payload as failed. forever $ withDequeue "queue_channel" conn emailDecoder 5 1 $ mapM_ sendEmail
Changelog for hasql-queue
- Better partial index #104
- Update README.md
Escape notification channel #100
Remove dequeued count from benchmarks #99
Document new api #98
Create teardown for migration #96
Extend API to use schemas #95
failuresand return all
Reorg API #89
Use a compound index to make the partial index work #86
Specialize single element dequeue #84
Delete instead of changing the state to dequeued #82
- Fixed cabal meta data and copyright
- First release!