on master help sign in
Rename reaper to mkReaper (thanks @kazu-yamamoto)
commita639e047e695b4f8e03a09ef6569b90ff7ea0cf4 authorMichael Snoyman <michael@snoyman.com> dateWed 6 Aug 2014, 08:46 (12 years ago) parent42ff2fd
4 files changed+8−8
auto-update/Control/Reaper.hs+5−5 auto-update/test/Control/ReaperSpec.hs+1−1 warp/Network/Wai/Handler/Warp/FdCache.hs+1−1 warp/Network/Wai/Handler/Warp/Timeout.hs+1−1
auto-update/Control/Reaper.hs+5−5
@@ -15,7 +15,7 @@ module Control.Reaper (
1515 , reaperNull
1616 , reaperEmpty
1717 -- * Creation
18− , reaper
18+ , mkReaper
1919 -- * Helper
2020 , mkListAction
2121 ) where
@@ -95,10 +95,10 @@ data State workload = NoReaper -- ^ No reaper thread
9595-- for you automatically.
9696--
9797-- Since 0.1.1
98−reaper :: ReaperSettings workload item
99− -> IO (item -> IO (), IORef (State workload))
100−reaper settings = do
101− stateRef <- newIORef NoReaper
98+mkReaper :: ReaperSettings workload item
99+ -> IO (item -> IO (), IORef (State workload))
100+mkReaper settings = do
101+ stateRef <- newIORef Nothing
102102 return (update settings stateRef, stateRef)
103103
104104update :: ReaperSettings workload item -> IORef (State workload) -> item
auto-update/test/Control/ReaperSpec.hs+1−1
@@ -10,7 +10,7 @@ type Item = (Int, IORef Int)
1010
1111spec :: Spec
1212spec = prop "works" $ \is -> do
13− (addItem, wlRef) <- reaper defaultReaperSettings
13+ (addItem, wlRef) <- mkReaper defaultReaperSettings
1414 { reaperAction = mkListAction $ \(i, ref) -> do
1515 modifyIORef ref succ
1616 return $ if i > 1
warp/Network/Wai/Handler/Warp/FdCache.hs+1−1
@@ -100,7 +100,7 @@ withFdCache duration action = bracket (initialize duration)
100100initialize :: Int -> IO (Maybe MutableFdCache)
101101initialize 0 = return Nothing
102102initialize duration = fmap (Just . uncurry MutableFdCache)
103− $ reaper defaultReaperSettings
103+ $ mkReaper defaultReaperSettings
104104 { reaperAction = clean
105105 , reaperDelay = duration
106106 , reaperCons = uncurry insert
warp/Network/Wai/Handler/Warp/Timeout.hs+1−1
@@ -80,7 +80,7 @@ data State = Active -- Manager turns it to Inactive.
8080-- where N is the first argument.
8181initialize :: Int -> IO Manager
8282initialize timeout =
83− fmap (uncurry Manager) $ reaper defaultReaperSettings
83+ fmap (uncurry Manager) $ mkReaper defaultReaperSettings
8484 { reaperAction = mkListAction prune
8585 , reaperDelay = timeout
8686 }