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

Travis CI Status

hasql-queue

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

Changes

Changelog for hasql-queue

  • 1.2.0.2

    • Better partial index #104
  • 1.2.0.1

    • Update README.md

-1.2.0.0

  • 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

  • 1.0.1.1

    • Fixed cabal meta data and copyright
  • 1.0.1

    • First release!