BSD-3-Clause licensed by Jonathan Fischoff
Maintained by [email protected]
This version can be pinned in stack with:hasql-queue-,4531

Travis CI Status


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


  • 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

  • Add delete to the AtLeastOnce APIs #92

  • Change failed function to failures and return all PayloadIds #91

  • 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
  • 1.0.1

    • First release!