faktory-1.0.1.2: Faktory Worker for Haskell

Safe HaskellNone
LanguageHaskell2010

Faktory.Client

Contents

Synopsis

Client operations

newClient :: HasCallStack => Settings -> Maybe WorkerId -> IO Client Source #

Open a new Client connection with the given Settings

High-level Job operations

pushJob :: (HasCallStack, ToJSON a) => Client -> a -> IO () Source #

Push a Job to the Server

flush :: HasCallStack => Client -> IO () Source #

Clear all job data in the Faktory server

Use with caution!

High-level Client API

command_ :: Client -> ByteString -> [ByteString] -> IO () Source #

Send a command, read and discard the response

commandOK :: HasCallStack => Client -> ByteString -> [ByteString] -> IO () Source #

Send a command, assert the response is OK

commandJSON :: FromJSON a => Client -> ByteString -> [ByteString] -> IO (Either String (Maybe a)) Source #

Send a command, parse the response as JSON