poolboy-0.1.0.1: Simple work queue for bounded concurrency
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Poolboy

Synopsis

Configuration

data PoolboySettings Source #

Initial settings

Constructors

PoolboySettings 

poolboySettingsWith :: Int -> PoolboySettings Source #

Arbitrary-numbered settings

simpleSerializedLogger :: IO (String -> IO ()) Source #

Simple (but not particularly performant) serialized logger

Running

withPoolboy :: PoolboySettings -> (WorkQueue -> IO a) -> IO a Source #

backet-based usage (recommended)

newPoolboy :: PoolboySettings -> IO WorkQueue Source #

Standalone/manual usage

stopWorkQueue :: WorkQueue -> IO () Source #

Request stopping wrokers

isStopWorkQueue :: WorkQueue -> IO Bool Source #

Non-blocking check of the work queue's running status

Driving

changeDesiredWorkersCount :: WorkQueue -> Int -> IO () Source #

Request a worker number adjustment

waitReadyQueue :: WorkQueue -> IO () Source #

Block until one worker is available

Enqueueing

enqueue :: WorkQueue -> IO () -> IO () Source #

Enqueue one action in the work queue (non-blocking)

enqueueAfter :: Foldable f => WorkQueue -> IO () -> f (IO ()) -> IO () Source #

Enqueue action and some actions to be run after it