hasql-queue: A PostgreSQL backed queue

[ bsd3, library, program, web ] [ Propose Tags ]

A PostgreSQL backed queue. Please see README.md

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 1.0.1,,,,
Change log CHANGELOG.md
Dependencies aeson, async, base (>=4.7 && <5), base64-bytestring, bytestring, cryptohash-sha1, exceptions, hasql, hasql-queue, here, monad-control, postgresql-libpq, postgresql-libpq-notify (>=, random, resource-pool, stm, text, time, tmp-postgres, transformers [details]
License BSD-3-Clause
Copyright 2020 Jonathan Fischoff
Author Jonathan Fischoff
Maintainer jonathangfischoff@gmail.com
Category Web
Home page https://github.com/jfischoff/hasql-queue#readme
Bug tracker https://github.com/jfischoff/hasql-queue/issues
Source repo head: git clone https://github.com/jfischoff/hasql-queue
Uploaded by JonathanFischoff at 2020-07-06T23:27:11Z
Executables hasql-queue-tmp-db, benchmark
Downloads 1122 total (19 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-07-06 [all 1 reports]

Readme for hasql-queue-

[back to package description]

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