packages feed

postgresql-simple-queue-0.5.0.1: postgresql-simple-queue.cabal

name:                postgresql-simple-queue
version:             0.5.0.1
synopsis: A PostgreSQL backed queue
description:
 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' "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" 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" conn $ pId payload
 >
 > To support multiple queues in the same database, the API expects a table name string
 > to determine which queue tables to use.
homepage:            https://github.com/jfischoff/postgresql-queue#readme
license:             BSD3
license-file:        LICENSE
author:              Jonathan Fischoff
maintainer:          jonathangfischoff@gmail.com
copyright:           2017 Jonathan Fischoff
category:            Web
build-type:          Simple
extra-source-files:  README.md
cabal-version:       >=1.10

library
  hs-source-dirs: src
  exposed-modules: Database.PostgreSQL.Simple.Queue
                 , Database.PostgreSQL.Simple.Queue.Migrate
  build-depends: base >= 4.7 && < 5
               , postgresql-simple
               , pg-transact
               , aeson
               , time
               , transformers
               , random
               , text
               , monad-control
               , exceptions
               , bytestring
  default-language:    Haskell2010
  ghc-options: -Wall -Wno-unused-do-bind

test-suite unit-tests
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is: Spec.hs
  other-modules: Database.PostgreSQL.Simple.QueueSpec
  build-depends: base
               , postgresql-simple-queue
               , hspec
               , hspec-discover
               , postgresql-simple
               , pg-transact
               , bytestring
               , aeson
               , hspec-expectations-lifted
               , hspec-pg-transact
               , async
  ghc-options: -Wall -Wno-unused-do-bind -O2 -threaded -rtsopts -with-rtsopts=-N
  default-language:    Haskell2010

source-repository head
  type:     git
  location: https://github.com/jfischoff/postgresql-queue