module Hasql.Queue.Low.AtMostOnce where
import qualified Hasql.Queue.Low.ExactlyOnce as E
import Hasql.Connection
import qualified Hasql.Encoders as E
import qualified Hasql.Decoders as D
import Data.Text(Text)
import qualified Hasql.Queue.Internal as I
enqueue :: Text
-> Connection
-> E.Value a
-> [a]
-> IO ()
enqueue channel conn encoder xs = I.runThrow (E.enqueue channel encoder xs) conn
dequeue :: Text
-> Connection
-> D.Value a
-> Int
-> IO [a]
dequeue channel conn theDecoder batchCount =
E.withDequeue channel conn theDecoder batchCount id