consumers-2.3.3.1: Concurrent PostgreSQL data consumers
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Consumers

Synopsis

Documentation

runConsumer Source #

Arguments

:: (MonadBaseControl IO m, MonadLog m, MonadMask m, MonadTime m, Eq idx, Show idx, FromSQL idx, ToSQL idx) 
=> ConsumerConfig m idx job

The consumer.

-> ConnectionSourceM m 
-> m (m ()) 

Run the consumer. The purpose of the returned monadic action is to wait for currently processed jobs and clean up. This function is best used in conjunction with finalize to seamlessly handle the finalization.

If you want to add metrics, see the consumers-metrics-prometheus package to seamlessly instrument your consumer.

runConsumerWithIdleSignal Source #

Arguments

:: (MonadBaseControl IO m, MonadLog m, MonadMask m, MonadTime m, Eq idx, Show idx, FromSQL idx, ToSQL idx) 
=> ConsumerConfig m idx job

The consumer.

-> ConnectionSourceM m 
-> TMVar Bool 
-> m (m ())