hasql-queue-1.2.0.2: A PostgreSQL backed queue

Safe HaskellNone
LanguageHaskell2010

Hasql.Queue.Internal

Description

Internal module. Changes to this modules are not reflected in the package version.

Synopsis

Documentation

data State Source #

A Payload can exist in three states in the queue, Enqueued, and Dequeued. A Payload starts in the Enqueued state and is locked so some sort of process can occur with it, usually something in IO. Once the processing is complete, the Payload is moved the Dequeued state, which is the terminal state.

Constructors

Enqueued 
Failed 
Instances
Bounded State Source # 
Instance details

Defined in Hasql.Queue.Internal

Enum State Source # 
Instance details

Defined in Hasql.Queue.Internal

Eq State Source # 
Instance details

Defined in Hasql.Queue.Internal

Methods

(==) :: State -> State -> Bool #

(/=) :: State -> State -> Bool #

Ord State Source # 
Instance details

Defined in Hasql.Queue.Internal

Methods

compare :: State -> State -> Ordering #

(<) :: State -> State -> Bool #

(<=) :: State -> State -> Bool #

(>) :: State -> State -> Bool #

(>=) :: State -> State -> Bool #

max :: State -> State -> State #

min :: State -> State -> State #

Show State Source # 
Instance details

Defined in Hasql.Queue.Internal

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

newtype PayloadId Source #

Internal payload id. Used by the public api as continuation token for pagination.

Constructors

PayloadId 

Fields

Instances
Eq PayloadId Source # 
Instance details

Defined in Hasql.Queue.Internal

Show PayloadId Source # 
Instance details

Defined in Hasql.Queue.Internal

data Payload a Source #

The fundemental record stored in the queue. The queue is a single table and each row consists of a Payload

Constructors

Payload 

Fields

Instances
Eq a => Eq (Payload a) Source # 
Instance details

Defined in Hasql.Queue.Internal

Methods

(==) :: Payload a -> Payload a -> Bool #

(/=) :: Payload a -> Payload a -> Bool #

Show a => Show (Payload a) Source # 
Instance details

Defined in Hasql.Queue.Internal

Methods

showsPrec :: Int -> Payload a -> ShowS #

show :: Payload a -> String #

showList :: [Payload a] -> ShowS #

getCount :: Session Int64 Source #

Get the number of rows in the Enqueued state.

data WithNotifyHandlers Source #

To aid in observability and white box testing

Constructors

WithNotifyHandlers 

Fields

data NoRows Source #

Constructors

NoRows 
Instances
Eq NoRows Source # 
Instance details

Defined in Hasql.Queue.Internal

Methods

(==) :: NoRows -> NoRows -> Bool #

(/=) :: NoRows -> NoRows -> Bool #

Show NoRows Source # 
Instance details

Defined in Hasql.Queue.Internal

Exception NoRows Source # 
Instance details

Defined in Hasql.Queue.Internal

fst3 :: (a, b, c) -> a Source #

snd3 :: (a, b, c) -> b Source #

trd3 :: (a, b, c) -> c Source #

failures Source #

Arguments

:: Value a

Payload decoder

-> Maybe PayloadId

Starting position of payloads. Pass Nothing to start at the beginning

-> Int

Count

-> Session [(PayloadId, a)] 

Retrieve the payloads that have entered a failed state. See withDequeue for how that occurs. The function returns a list of values and an id. The id is used the starting place for the next batch of values. If Nothing is passed the list starts at the beginning.

withDequeue :: Value a -> Int -> Int -> ([a] -> IO b) -> Session (Maybe b) Source #