auto-update 0.2.1 → 0.2.2
raw patch · 6 files changed
+20/−5 lines, 6 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Control.AutoUpdate: updateThreadName :: UpdateSettings a -> String
+ Control.Debounce: debounceThreadName :: DebounceSettings -> String
+ Control.Debounce.Internal: [debounceThreadName] :: DebounceSettings -> String
+ Control.Reaper: reaperThreadName :: ReaperSettings workload item -> String
- Control.Debounce.Internal: DebounceSettings :: Int -> IO () -> DebounceEdge -> DebounceSettings
+ Control.Debounce.Internal: DebounceSettings :: Int -> IO () -> DebounceEdge -> String -> DebounceSettings
Files
- ChangeLog.md +6/−0
- Control/AutoUpdate.hs +4/−1
- Control/Debounce.hs +2/−0
- Control/Debounce/Internal.hs +3/−2
- Control/Reaper.hs +4/−1
- auto-update.cabal +1/−1
ChangeLog.md view
@@ -1,5 +1,11 @@ # ChangeLog for auto-update +## 0.2.2++* NewAPI: updateThreadName, reaperThreadName, debounceThreadName:+ Names can be given via this field to threads+ for GHC.Conc.Sync.listThreads.+ ## 0.2.1 * Labeling threads.
Control/AutoUpdate.hs view
@@ -38,6 +38,7 @@ updateAction, updateFreq, updateSpawnThreshold,+ updateThreadName, -- * Creation mkAutoUpdate,@@ -76,6 +77,7 @@ { updateFreq = 1000000 , updateSpawnThreshold = 3 , updateAction = return ()+ , updateThreadName = "AutoUpdate" } -- | Settings to control how values are updated.@@ -112,6 +114,7 @@ -- Default: does nothing. -- -- @since 0.1.0+ , updateThreadName :: String } -- | Generate an action which will either read from an automatically@@ -201,7 +204,7 @@ -- Kick off the loop, with the initial responseVar0 variable. loop responseVar0 Nothing- labelThread tid "AutoUpdate"+ labelThread tid $ updateThreadName us return $ do mval <- readIORef currRef case mval of
Control/Debounce.hs view
@@ -31,6 +31,7 @@ DI.debounceFreq, DI.debounceAction, DI.debounceEdge,+ DI.debounceThreadName, DI.leadingEdge, DI.trailingEdge, @@ -50,6 +51,7 @@ { DI.debounceFreq = 1000000 , DI.debounceAction = return () , DI.debounceEdge = DI.leadingEdge+ , DI.debounceThreadName = "Debounce" } -- | Generate an action which will trigger the debounced action to be performed.
Control/Debounce/Internal.hs view
@@ -52,6 +52,7 @@ -- Default: 'trailingEdge'. -- -- @since 0.1.6+ , debounceThreadName :: String } -- | Setting to control whether the action happens at the leading and/or trailing@@ -85,7 +86,7 @@ mkDebounceInternal :: MVar () -> (Int -> IO ()) -> DebounceSettings -> IO (IO ())-mkDebounceInternal baton delayFn (DebounceSettings freq action edge) = do+mkDebounceInternal baton delayFn (DebounceSettings freq action edge name) = do tid <- mask_ $ forkIO $ forever $ do takeMVar baton case edge of@@ -97,7 +98,7 @@ -- Empty the baton of any other activations during the interval void $ tryTakeMVar baton ignoreExc action- labelThread tid "Denounce"+ labelThread tid name return $ void $ tryPutMVar baton () ignoreExc :: IO () -> IO ()
Control/Reaper.hs view
@@ -25,6 +25,7 @@ reaperCons, reaperNull, reaperEmpty,+ reaperThreadName, -- * Type Reaper,@@ -94,6 +95,7 @@ -- Default: empty list. -- -- @since 0.1.1+ , reaperThreadName :: String } -- | Default @ReaperSettings@ value, biased towards having a list of work@@ -108,6 +110,7 @@ , reaperCons = (:) , reaperNull = null , reaperEmpty = []+ , reaperThreadName = "Reaper" } -- | State of reaper.@@ -182,7 +185,7 @@ -> IO () spawn settings stateRef tidRef = do tid <- forkIO $ reaper settings stateRef tidRef- labelThread tid "Reaper"+ labelThread tid $ reaperThreadName settings writeIORef tidRef $ Just tid reaper
auto-update.cabal view
@@ -1,5 +1,5 @@ name: auto-update-version: 0.2.1+version: 0.2.2 synopsis: Efficiently run periodic, on-demand actions description: API docs and the README are available at <http://www.stackage.org/package/auto-update>. homepage: https://github.com/yesodweb/wai