wolf 0.3.25 → 0.3.26
raw patch · 6 files changed
+29/−29 lines, 6 filesdep ~preambledep ~shakers
Dependency ranges changed: preamble, shakers
Files
- src/Network/AWS/Wolf/Act.hs +4/−4
- src/Network/AWS/Wolf/Ctx.hs +1/−1
- src/Network/AWS/Wolf/Decide.hs +5/−5
- src/Network/AWS/Wolf/File.hs +7/−7
- src/Network/AWS/Wolf/SWF.hs +9/−9
- wolf.cabal +3/−3
src/Network/AWS/Wolf/Act.hs view
@@ -29,7 +29,7 @@ key = do b <- view cBucket <$> view ccConf p <- view ascPrefix- return $ "s3:/" -/- textToString b -/- textToString p+ pure $ "s3:/" -/- textToString b -/- textToString p -- | Download artifacts to the store input directory. --@@ -49,9 +49,9 @@ -- callCommand' :: MonadControl m => String -> m (Maybe SomeException) callCommand' command =- handle (return . Just) $ do+ handle (pure . Just) $ do liftIO $ callCommand command- return Nothing+ pure Nothing -- | Run command and maybe returns an exception. --@@ -61,7 +61,7 @@ traceInfo "begin" mempty e <- callCommand' command traceInfo "end" [ "exception" .= (displayException <$> e) ]- return e+ pure e -- | Actor logic - poll for work, download artifacts, run command, upload artifacts. --
src/Network/AWS/Wolf/Ctx.hs view
@@ -34,7 +34,7 @@ botErrorCatch ex = do case ex of TransportError _ ->- return ()+ pure () _ -> traceError "exception" [ "error" .= displayException ex ] throwIO ex
src/Network/AWS/Wolf/Decide.hs view
@@ -25,7 +25,7 @@ end :: MonadAmazonDecision c m => Maybe Text -> m Decision end input = do traceInfo "end" mempty- return $ completeWork input+ pure $ completeWork input -- | Next activity in workflow to run. --@@ -33,14 +33,14 @@ next input t = do uid <- liftIO $ toText <$> nextRandom traceInfo "next" [ "uid" .= uid, "task" .= t ]- return $ scheduleWork uid (t ^. tName) (t ^. tVersion) (t ^. tQueue) input+ pure $ scheduleWork uid (t ^. tName) (t ^. tVersion) (t ^. tQueue) input -- | Failed activity, stop the workflow. -- failed :: MonadAmazonDecision c m => m Decision failed = do traceInfo "failed" mempty- return failWork+ pure failWork -- | Completed activity, start the next activity. --@@ -52,7 +52,7 @@ atcea <- he ^. heActivityTaskCompletedEventAttributes he' <- flip find hes $ (== atcea ^. atceaScheduledEventId) . view heEventId name <- view atName . view atseaActivityType <$> he' ^. heActivityTaskScheduledEventAttributes- return (atcea ^. atceaResult, name)+ pure (atcea ^. atceaResult, name) p <- view adcPlan maybe (end input) (next input) $ join $ fmap headMay $ tailMay $ flip dropWhile (p ^. pTasks) $ (/= name) . view tName@@ -76,7 +76,7 @@ f hes >>= maybeThrowIO' "No Select Information" where- f [] = return Nothing+ f [] = pure Nothing f (he:hes) = case he ^. heEventType of WorkflowExecutionStarted -> Just <$> begin he
src/Network/AWS/Wolf/File.hs view
@@ -46,7 +46,7 @@ dataDirectory dir = do let dir' = dir </> "data" liftIO $ createDirectoryIfMissing True dir'- return dir'+ pure dir' -- | Determine path to store directory and create it. --@@ -54,7 +54,7 @@ storeDirectory dir = do let dir' = dir </> "store" liftIO $ createDirectoryIfMissing True dir'- return dir'+ pure dir' -- | Determine path to store input directory and create it. --@@ -62,7 +62,7 @@ inputDirectory dir = do let dir' = dir </> "input" liftIO $ createDirectoryIfMissing True dir'- return dir'+ pure dir' -- | Determine path to store output directory and create it. --@@ -70,7 +70,7 @@ outputDirectory dir = do let dir' = dir </> "output" liftIO $ createDirectoryIfMissing True dir'- return dir'+ pure dir' -- | Maybe write text to a file. --@@ -84,8 +84,8 @@ readText file = liftIO $ do b <- doesFileExist file- if not b then return mempty else- return <$> readFile file+ if not b then pure mempty else+ pure <$> readFile file -- | Encode from JSON and write file. --@@ -111,7 +111,7 @@ time <- getCurrentTime let dir = td </> formatTime defaultTimeLocale "%FT%T%z" time </> textToString uid createDirectoryIfMissing True dir- return dir+ pure dir -- | Copy directory contents recursively. --
src/Network/AWS/Wolf/SWF.hs view
@@ -32,7 +32,7 @@ tl <- taskList <$> view awcQueue runResourceT $ runAmazonCtx $ do pfatrs <- send (pollForActivityTask d tl)- return+ pure ( pfatrs ^. pfatrsTaskToken , view weWorkflowId <$> pfatrs ^. pfatrsWorkflowExecution , pfatrs ^. pfatrsInput@@ -46,7 +46,7 @@ tl <- taskList <$> view awcQueue runResourceT $ runAmazonCtx $ do pfdtrs <- paginate (pollForDecisionTask d tl) $$ consume- return+ pure ( join $ headMay $ map (view pfdtrsTaskToken) pfdtrs , reverse $ concatMap (view pfdtrsEvents) pfdtrs )@@ -59,7 +59,7 @@ tl <- taskList <$> view awcQueue runResourceT $ runAmazonCtx $ do ptc <- send (countPendingActivityTasks d tl)- return $ fromIntegral (ptc ^. ptcCount)+ pure $ fromIntegral (ptc ^. ptcCount) -- | Count decisions. --@@ -69,7 +69,7 @@ tl <- taskList <$> view awcQueue runResourceT $ runAmazonCtx $ do ptc <- send (countPendingDecisionTasks d tl)- return $ fromIntegral (ptc ^. ptcCount)+ pure $ fromIntegral (ptc ^. ptcCount) -- | Successful job completion. --@@ -90,18 +90,18 @@ completeDecision :: MonadConf c m => Text -> Decision -> m () completeDecision token d = runResourceT $ runAmazonCtx $- void $ send $ set rdtcDecisions (return d) $ respondDecisionTaskCompleted token+ void $ send $ set rdtcDecisions (pure d) $ respondDecisionTaskCompleted token -- | Schedule decision. -- scheduleWork :: Text -> Text -> Text -> Text -> Maybe Text -> Decision scheduleWork uid name version queue input = decision ScheduleActivityTask &- dScheduleActivityTaskDecisionAttributes .~ return satda+ dScheduleActivityTaskDecisionAttributes .~ pure satda where satda = scheduleActivityTaskDecisionAttributes (activityType name version) uid &- satdaTaskList .~ return (taskList queue) &+ satdaTaskList .~ pure (taskList queue) & satdaInput .~ input -- | Complete decision.@@ -109,7 +109,7 @@ completeWork :: Maybe Text -> Decision completeWork input = decision CompleteWorkflowExecution &- dCompleteWorkflowExecutionDecisionAttributes .~ return cweda+ dCompleteWorkflowExecutionDecisionAttributes .~ pure cweda where cweda = completeWorkflowExecutionDecisionAttributes &@@ -120,7 +120,7 @@ failWork :: Decision failWork = decision FailWorkflowExecution &- dFailWorkflowExecutionDecisionAttributes .~ return fweda+ dFailWorkflowExecutionDecisionAttributes .~ pure fweda where fweda = failWorkflowExecutionDecisionAttributes
wolf.cabal view
@@ -1,5 +1,5 @@ name: wolf-version: 0.3.25+version: 0.3.26 cabal-version: >=1.22 build-type: Simple license: MIT@@ -34,7 +34,7 @@ http-types >=0.9.1, lifted-async >=0.9.1.1, lifted-base >=0.2.3.11,- preamble >=0.0.48,+ preamble >=0.0.49, process >=1.2.3.0, time >=1.5.0.1, uuid >=1.3.13,@@ -89,7 +89,7 @@ main-is: Shakefile.hs build-depends: base >=4.8 && <5,- shakers >=0.0.28+ shakers >=0.0.31 default-language: Haskell2010 ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall