-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Simple work queue for bounded concurrency
--
-- In-memory work queue helping with load management.
@package poolboy
@version 0.2.0.0
module Data.Poolboy
-- | Initial settings
data PoolboySettings
PoolboySettings :: WorkersCountSettings -> (String -> IO ()) -> PoolboySettings
[$sel:workersCount:PoolboySettings] :: PoolboySettings -> WorkersCountSettings
[$sel:log:PoolboySettings] :: PoolboySettings -> String -> IO ()
-- | Initial number of threads
data WorkersCountSettings
-- | getNumCapabilities based number
CapabilitiesWCS :: WorkersCountSettings
FixedWCS :: Int -> WorkersCountSettings
-- | Usual configuration CapabilitiesWCS and no log
defaultPoolboySettings :: PoolboySettings
-- | Arbitrary-numbered settings
poolboySettingsWith :: Int -> PoolboySettings
-- | Simple (but not particularly performant) serialized logger
simpleSerializedLogger :: IO (String -> IO ())
data WorkQueue
-- | backet-based usage (recommended)
withPoolboy :: PoolboySettings -> WaitingStopStrategy -> (WorkQueue -> IO a) -> IO a
-- | Standalone/manual usage
newPoolboy :: PoolboySettings -> IO WorkQueue
-- | Request a worker number adjustment
changeDesiredWorkersCount :: WorkQueue -> Int -> IO ()
-- | Block until one worker is available
waitReadyQueue :: WorkQueue -> IO ()
-- | Request stopping wrokers
stopWorkQueue :: WorkQueue -> IO ()
-- | Non-blocking check of the work queue's running status
isStopedWorkQueue :: WorkQueue -> IO Bool
type WaitingStopStrategy = WorkQueue -> IO ()
-- | Block until the queue is totally stopped or deadline (in micro
-- seconds) is reached
waitingStopTimeout :: Int -> WaitingStopStrategy
-- | Block until the queue is totally stopped (no more running worker)
waitingStopFinishWorkers :: WaitingStopStrategy
-- | Enqueue one action in the work queue (non-blocking)
enqueue :: WorkQueue -> IO () -> IO ()
-- | Enqueue action and some actions to be run after it
enqueueAfter :: Foldable f => WorkQueue -> IO () -> f (IO ()) -> IO ()
instance GHC.Show.Show Data.Poolboy.WorkersCountSettings
instance GHC.Classes.Eq Data.Poolboy.WorkersCountSettings
instance GHC.Show.Show Data.Poolboy.Commands