Workflow 0.7.0.6 → 0.7.0.7
raw patch · 4 files changed
+21/−11 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Control.Workflow.Configuration: runConfiguration :: String -> WF Stat IO a -> IO ()
+ Control.Workflow.Configuration: runConfiguration :: (Monad m, MonadIO m, MonadCatchIO m) => String -> Workflow m a -> m a
Files
- Control/Workflow.hs +10/−4
- Control/Workflow/Configuration.hs +6/−5
- Demos/pr.hs +4/−1
- Workflow.cabal +1/−1
Control/Workflow.hs view
@@ -659,9 +659,15 @@ mst <- readDBRef sref stat' <- case mst of Nothing -> error $ "getState: Workflow not found: "++ key- Just s -> do+ Just s' -> do -- the thread may have been killed by an exception when running- when(not $ recover s) $ error ("flow "++key++ "found in a wrong state: report it")+ s <- case recover s' of+ True -> return s'+ False -> do+ s'' <- safeIOToSTM $ readResource s' `onNothing` return stat1+ let i= state s''+ j= state s'+ return s'{versions= versions s'' ++ L.reverse ( L.take ( j - i) $ versions s')} if isJust (timeout s) then do tnow <- unsafeIOToSTM getTimeSeconds@@ -700,7 +706,7 @@ clearFromRunningList n = atomicallySync $ do Just(Running map) <- readDBRef tvRunningWfs -- !> "clearFormRunning" writeDBRef tvRunningWfs . Running $ M.delete n map -- `debug` "clearFromRunningList"- flushDBRef (getDBRef n :: DBRef Stat)+-- flushDBRef (getDBRef n :: DBRef Stat) -- | Start or continue a workflow from a list of workflows with exception handling. -- see 'start' for details about exception and error handling startWF@@ -886,7 +892,7 @@ Just(_, Nothing) -> return (map,Nothing) Just(v, Just th) -> do writeDBRef tvRunningWfs . Running $ M.insert name (v, Nothing) map- flushDBRef (getDBRef $ keyResource stat0{wfName=name} :: DBRef Stat)+-- flushDBRef (getDBRef $ keyResource stat0{wfName=name} :: DBRef Stat) return (map,Just th) Nothing -> return (map, Nothing)
Control/Workflow/Configuration.hs view
@@ -16,6 +16,7 @@ import Data.RefSerialize import Control.Monad.Trans import Control.Exception+import Control.Monad.CatchIO as CMC -------------- configuation -- | to execute a computation every time it is invoked. A synonimous of `unsafeIOtoWF`@@ -27,8 +28,8 @@ once= step -- | executes a computation with `once` and `ever` statements-runConfiguration confname confProc = handle (\(e :: SomeException) -> return ())- $ exec1 confname $ do- confProc- error ""- step $ return ()+-- a synonym of `exec1nc`+runConfiguration :: ( Monad m, MonadIO m, CMC.MonadCatchIO m)+ => String -> Workflow m a -> m a+runConfiguration = exec1nc+
Demos/pr.hs view
@@ -4,7 +4,10 @@ -main = getName >>= putStrLn+main = do+ syncWrite SyncManual+ getName >>= putStrLn+ main getName= exec1nc "test" $ do name <- step $ do
Workflow.cabal view
@@ -1,5 +1,5 @@ name: Workflow-version: 0.7.0.6+version: 0.7.0.7 cabal-version: >= 1.6 build-type: Simple license: BSD3