| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hasql.Queue.Internal
Description
Internal module. Changes to this modules are not reflected in the package version.
Synopsis
- data State
- state :: Params a -> Result b -> ByteString -> Statement a b
- stateDecoder :: Value State
- stateEncoder :: Value State
- initialPayloadId :: PayloadId
- newtype PayloadId = PayloadId {
- unPayloadId :: Int64
- data Payload a = Payload {}
- payloadDecoder :: Value a -> Row (Payload a)
- payloadIdEncoder :: Value PayloadId
- payloadIdDecoder :: Value PayloadId
- payloadIdRow :: Row PayloadId
- enqueuePayload :: Value a -> [a] -> Session [PayloadId]
- dequeuePayload :: Value a -> Int -> Session [Payload a]
- getPayload :: Value a -> PayloadId -> Session (Maybe (Payload a))
- getCount :: Session Int64
- incrementAttempts :: Int -> [PayloadId] -> Session ()
- newtype QueryException = QueryException QueryError
- runThrow :: Session a -> Connection -> IO a
- execute :: Connection -> ByteString -> IO ()
- notifyPayload :: ByteString -> Connection -> IO ()
- data WithNotifyHandlers = WithNotifyHandlers {}
- data NoRows = NoRows
- withNotifyWith :: WithNotifyHandlers -> Text -> Connection -> Session a -> IO a
- fst3 :: (a, b, c) -> a
- snd3 :: (a, b, c) -> b
- trd3 :: (a, b, c) -> c
- listState :: State -> Value a -> Maybe PayloadId -> Int -> Session [(PayloadId, a)]
- failures :: Value a -> Maybe PayloadId -> Int -> Session [(PayloadId, a)]
- withDequeue :: Value a -> Int -> Int -> ([a] -> IO b) -> Session (Maybe b)
- delete :: [PayloadId] -> Session ()
Documentation
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.
Internal payload id. Used by the public api as continuation token for pagination.
Constructors
| PayloadId | |
Fields
| |
The fundemental record stored in the queue. The queue is a single table
and each row consists of a Payload
Constructors
| Payload | |
newtype QueryException Source #
Constructors
| QueryException QueryError |
Instances
| Eq QueryException Source # | |
Defined in Hasql.Queue.Internal Methods (==) :: QueryException -> QueryException -> Bool # (/=) :: QueryException -> QueryException -> Bool # | |
| Show QueryException Source # | |
Defined in Hasql.Queue.Internal Methods showsPrec :: Int -> QueryException -> ShowS # show :: QueryException -> String # showList :: [QueryException] -> ShowS # | |
| Exception QueryException Source # | |
Defined in Hasql.Queue.Internal Methods toException :: QueryException -> SomeException # | |
execute :: Connection -> ByteString -> IO () Source #
notifyPayload :: ByteString -> Connection -> IO () Source #
data WithNotifyHandlers Source #
To aid in observability and white box testing
Constructors
| WithNotifyHandlers | |
Fields
| |
Instances
| Semigroup WithNotifyHandlers Source # | |
Defined in Hasql.Queue.Internal Methods (<>) :: WithNotifyHandlers -> WithNotifyHandlers -> WithNotifyHandlers # sconcat :: NonEmpty WithNotifyHandlers -> WithNotifyHandlers # stimes :: Integral b => b -> WithNotifyHandlers -> WithNotifyHandlers # | |
| Monoid WithNotifyHandlers Source # | |
Defined in Hasql.Queue.Internal Methods mempty :: WithNotifyHandlers # mappend :: WithNotifyHandlers -> WithNotifyHandlers -> WithNotifyHandlers # mconcat :: [WithNotifyHandlers] -> WithNotifyHandlers # | |
Constructors
| NoRows |
Instances
| Eq NoRows Source # | |
| Show NoRows Source # | |
| Exception NoRows Source # | |
Defined in Hasql.Queue.Internal Methods toException :: NoRows -> SomeException # fromException :: SomeException -> Maybe NoRows # displayException :: NoRows -> String # | |
withNotifyWith :: WithNotifyHandlers -> Text -> Connection -> Session a -> IO a Source #
Arguments
| :: Value a | Payload decoder |
| -> Maybe PayloadId | Starting position of payloads. Pass |
| -> 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.