Movatterモバイル変換


[0]ホーム

URL:


Hackage :: [Package]

postgresql-simple-queue:A PostgreSQL backed queue

[bsd3,library,web ] [Propose Tags ] [Report a vulnerability ]

This module utilize PostgreSQL to implement a durable queue for efficently processing arbitrary payloads which can be represented as JSON.

Typically a producer would enqueue a new payload as part of larger databasetransaction

 createAccount userRecord = do    'runDBTSerializable' $ do       createUserDB userRecord       'enqueueDB' "queue_schema" $ makeVerificationEmail userRecord

In another thread or process, the consumer would drain the queue.

  forever $ do    -- Attempt get a payload or block until one is available    payload <- lock "queue_schema" conn    -- Perform application specifc parsing of the payload value    case fromJSON $ pValue payload of      Success x -> sendEmail x -- Perform application specific processing      Error err -> logErr err    -- Remove the payload from future processing    dequeue "queue_schema" conn $ pId payloadTo support multiple queues in the same database, the API expects a schema name stringto determine which queue tables to use.

[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions[RSS]0.1.0.0,0.1.0.1,0.2.0.0,0.2.1.0,0.3.0.0,0.4.0.0,0.5.0.0,0.5.0.1,0.5.1.0,0.5.1.1,1.0.0,1.0.1
Dependenciesaeson,amazonka,amazonka-ses,base (>=4.7 && <5),bytestring,data-default,exceptions,lens,lifted-async,lifted-base,monad-control,optparse-generic (>=1.2.1),pg-transact,postgresql-simple,postgresql-simple-opts,postgresql-simple-queue,random,resource-pool,text,time,transformers,uuid [details]
LicenseBSD-3-Clause
Copyright2017 Jonathan Fischoff
AuthorJonathan Fischoff
Maintainerjonathangfischoff@gmail.com
CategoryWeb
Home pagehttps://github.com/jfischoff/postgresql-queue#readme
Source repohead: git clonehttps://github.com/jfischoff/postgresql-queue
UploadedbyJonathanFischoff at2017-07-22T21:09:59Z
Distributions
Reverse Dependencies1 direct, 0 indirect [details]
Executablesasync-email-example
Downloads7582 total (11 in the last 30 days)
Rating(no votes yet)[estimated byBayesian average]
Your Rating
  • λ
  • λ
  • λ
StatusDocs available[build log]
Last success reported on 2017-07-22[all 1 reports]

Readme for postgresql-simple-queue-0.2.0.0

[back to package description]

postgresql-simple-queue

This module utilize PostgreSQL to implement a durable queue for efficently processing arbitrary payloads which can be represented as JSON.

Typically a producer would enqueue a new payload as part of larger database transaction

createAccount userRecord = do  runDBTSerializable $ do    createUserDB userRecord    enqueueDB $ makeVerificationEmail userRecord

In another thread or process, the consumer would drain the queue.

  forever $ do    -- Attempt get a payload or block until one is available    payload <- lock conn    -- Perform application specifc parsing of the payload value    case fromJSON $ pValue payload of      Success x -> sendEmail x -- Perform application specific processing      Error err -> logErr err    -- Remove the payload from future processing    dequeue conn $ pId payload

Installation

stack install postgresql-simple-queue

Blog

This package was discussed in the blogTesting PostgreSQL for Fun

Produced byhackage andCabal 3.12.1.0.


[8]ページ先頭

©2009-2025 Movatter.jp