@@ -1,4 +1,5 @@
11{-# LANGUAGE CPP #-}
2+{-# LANGUAGE RankNTypes #-}
23{-# OPTIONS_GHC -fno-warn-deprecations #-}
34
45---------------------------------------------------------
@@ -42,6 +43,7 @@ module Network.Wai.Handler.Warp (
4243 , setInstallShutdownHandler
4344 , setServerName
4445 , setMaximumBodyFlush
46+ , setFork
4547 -- ** Getters
4648 , getPort
4749 , getHost
@@ -228,3 +230,14 @@ setMaximumBodyFlush :: Maybe Int -> Settings -> Settings
228230setMaximumBodyFlush x y
229231 | Just x' <- x, x' < 0 = error "setMaximumBodyFlush: must be positive"
230232 | otherwise = y { settingsMaximumBodyFlush = x }
233+
234+-- | Code to fork a new thread to accept a connection.
235+--
236+-- This may be useful if you need OS bound threads, or if
237+-- you wish to develop an alternative threading model.
238+--
239+-- Default: void . forkIOWithUnmask
240+--
241+-- Since 3.0.4
242+setFork :: (((forall a. IO a -> IO a) -> IO ()) -> IO ()) -> Settings -> Settings
243+setFork fork' s = s { settingsFork = fork' }