Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data PoolboySettings = PoolboySettings {
- workersCount :: WorkersCountSettings
- log :: String -> IO ()
- data WorkersCountSettings
- defaultPoolboySettings :: PoolboySettings
- poolboySettingsWith :: Int -> PoolboySettings
- simpleSerializedLogger :: IO (String -> IO ())
- data WorkQueue
- withPoolboy :: PoolboySettings -> WaitingStopStrategy -> (WorkQueue -> IO a) -> IO a
- newPoolboy :: PoolboySettings -> IO WorkQueue
- changeDesiredWorkersCount :: WorkQueue -> Int -> IO ()
- waitReadyQueue :: WorkQueue -> IO ()
- stopWorkQueue :: WorkQueue -> IO ()
- isStopedWorkQueue :: WorkQueue -> IO Bool
- type WaitingStopStrategy = WorkQueue -> IO ()
- waitingStopTimeout :: Int -> WaitingStopStrategy
- waitingStopFinishWorkers :: WaitingStopStrategy
- enqueue :: WorkQueue -> IO () -> IO ()
- enqueueAfter :: Foldable f => WorkQueue -> IO () -> f (IO ()) -> IO ()
Configuration
data PoolboySettings Source #
Initial settings
PoolboySettings | |
|
data WorkersCountSettings Source #
Initial number of threads
CapabilitiesWCS |
|
FixedWCS Int |
Instances
Show WorkersCountSettings Source # | |
Defined in Data.Poolboy showsPrec :: Int -> WorkersCountSettings -> ShowS # show :: WorkersCountSettings -> String # showList :: [WorkersCountSettings] -> ShowS # | |
Eq WorkersCountSettings Source # | |
Defined in Data.Poolboy (==) :: WorkersCountSettings -> WorkersCountSettings -> Bool # (/=) :: WorkersCountSettings -> WorkersCountSettings -> Bool # |
defaultPoolboySettings :: PoolboySettings Source #
Usual configuration CapabilitiesWCS
and no log
poolboySettingsWith :: Int -> PoolboySettings Source #
Arbitrary-numbered settings
simpleSerializedLogger :: IO (String -> IO ()) Source #
Simple (but not particularly performant) serialized logger
Running
withPoolboy :: PoolboySettings -> WaitingStopStrategy -> (WorkQueue -> IO a) -> IO a Source #
backet
-based usage (recommended)
newPoolboy :: PoolboySettings -> IO WorkQueue Source #
Standalone/manual usage
Driving
waitReadyQueue :: WorkQueue -> IO () Source #
Block until one worker is available
Stopping
stopWorkQueue :: WorkQueue -> IO () Source #
Request stopping wrokers
isStopedWorkQueue :: WorkQueue -> IO Bool Source #
Non-blocking check of the work queue's running status
type WaitingStopStrategy = WorkQueue -> IO () Source #
waitingStopTimeout :: Int -> WaitingStopStrategy Source #
Block until the queue is totally stopped or deadline (in micro seconds) is reached
waitingStopFinishWorkers :: WaitingStopStrategy Source #
Block until the queue is totally stopped (no more running worker)