@@ -8,6 +8,7 @@ module Network.Wai.Handler.Warp.Timeout (
88 -- ** Manager
99 , initialize
1010 , stopManager
11+ , killManager
1112 , withManager
1213 -- ** Registration
1314 , register
@@ -69,7 +70,7 @@ initialize timeout = mkReaper defaultReaperSettings
6970
7071----------------------------------------------------------------
7172
72−-- | Stopping timeout manager.
73+-- | Stopping timeout manager with onTimeout fired.
7374stopManager :: Manager -> IO ()
7475stopManager mgr = E.mask_ (reaperStop mgr >>= mapM_ fire)
7576 where
@@ -80,6 +81,14 @@ stopManager mgr = E.mask_ (reaperStop mgr >>= mapM_ fire)
8081ignoreAll :: E.SomeException -> IO ()
8182ignoreAll _ = return ()
8283
84+-- | Killing timeout manager immediately without firing onTimeout.
85+killManager :: Manager -> IO ()
86+killManager mgr = E.mask_ (reaperStop mgr >>= mapM_ fire)
87+ where
88+ fire (Handle actionRef _) = do
89+ onTimeout <- I.readIORef actionRef
90+ onTimeout `E.catch` ignoreAll
91+
8392----------------------------------------------------------------
8493
8594-- | Registering a timeout action.