loup 0.0.14 → 0.0.15
raw patch · 5 files changed
+24/−24 lines, 5 filesdep ~preambledep ~shakersPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: preamble, shakers
API changes (from Hackage documentation)
Files
- loup.cabal +3/−3
- src/Network/AWS/Loup/Act.hs +2/−2
- src/Network/AWS/Loup/Converge.hs +4/−4
- src/Network/AWS/Loup/Ctx.hs +1/−1
- src/Network/AWS/Loup/Decide.hs +14/−14
loup.cabal view
@@ -1,5 +1,5 @@ name: loup-version: 0.0.14+version: 0.0.15 cabal-version: >=1.22 build-type: Simple license: MIT@@ -29,7 +29,7 @@ conduit >=1.2.10, lifted-async >=0.9.1.1, lifted-base >=0.2.3.11,- preamble >=0.0.48,+ preamble >=0.0.49, time >=1.5.0.1, turtle >=1.3.6, unordered-containers >=0.2.8.0,@@ -84,7 +84,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
src/Network/AWS/Loup/Act.hs view
@@ -26,7 +26,7 @@ pollActivity domain list = runResourceT $ runAmazonCtx $ do pfatrs <- send $ pollForActivityTask domain list- return (pfatrs ^. pfatrsTaskToken, pfatrs ^. pfatrsInput)+ pure (pfatrs ^. pfatrsTaskToken, pfatrs ^. pfatrsInput) -- | Cancel activity. --@@ -48,7 +48,7 @@ heartbeat token = runResourceT $ runAmazonCtx $ do rathrs <- send $ recordActivityTaskHeartbeat token- return $ rathrs ^. rathrsCancelRequested+ pure (rathrs ^. rathrsCancelRequested) -- | Run a managed action inside a temp directory. --
src/Network/AWS/Loup/Converge.hs view
@@ -26,9 +26,9 @@ runResourceT $ runAmazonCtx $ do let etf = executionTimeFilter $ posixSecondsToUTCTime $ fromIntegral (0 :: Int) wtf = workflowTypeFilter (activity ^. atName)- weis <- pages $ set loweTypeFilter (return wtf) $ listOpenWorkflowExecutions domain etf+ weis <- pages $ set loweTypeFilter (pure wtf) $ listOpenWorkflowExecutions domain etf let predicate wei = maybe True not $ wei ^. weiCancelRequested- return $ view weWorkflowId . view weiExecution <$> filter predicate (join $ view weiExecutionInfos <$> weis)+ pure $ view weWorkflowId . view weiExecution <$> filter predicate (join $ view weiExecutionInfos <$> weis) -- | Start a workflow. --@@ -37,7 +37,7 @@ runResourceT $ runAmazonCtx $ do let wt = workflowType (activity ^. atName) (activity ^. atVersion) void $ send $ startWorkflowExecution domain wid wt- & sTaskList .~ return list+ & sTaskList .~ pure list & sInput .~ input -- | Cancel a workflow.@@ -57,7 +57,7 @@ let fold kvs as action = do let g k v bs = do let k' = k -.- textShow (hash v)- if k' `member` bs then return $ k' `delete` bs else action k' v >> return bs+ if k' `member` bs then pure $ k' `delete` bs else action k' v >> pure bs ifoldrM g as kvs wids' <- fold (pool ^. pWorkers) wids $ \wid input -> do traceInfo "start" [ "wid" .= wid, "input" .= input ]
src/Network/AWS/Loup/Ctx.hs view
@@ -30,7 +30,7 @@ botErrorCatch ex = do case ex of TransportError _ ->- return ()+ pure () _ -> traceError "exception" [ "error" .= displayException ex ] throwIO ex
src/Network/AWS/Loup/Decide.hs view
@@ -25,7 +25,7 @@ pollDecision domain list = runResourceT $ runAmazonCtx $ do pfdtrs <- pages $ pollForDecisionTask domain list- return (join $ headMay $ view pfdtrsTaskToken <$> pfdtrs, reverse $ join $ view pfdtrsEvents <$> pfdtrs)+ pure (join $ headMay $ view pfdtrsTaskToken <$> pfdtrs, reverse $ join $ view pfdtrsEvents <$> pfdtrs) -- | Successful decision completion. --@@ -40,10 +40,10 @@ scheduleActivity :: UUID -> ActivityType -> TaskList -> Maybe Text -> Decision scheduleActivity uid activity list input = do let satda = scheduleActivityTaskDecisionAttributes activity (toText uid)- & satdaTaskList .~ return list+ & satdaTaskList .~ pure list & satdaInput .~ input decision ScheduleActivityTask- & dScheduleActivityTaskDecisionAttributes .~ return satda+ & dScheduleActivityTaskDecisionAttributes .~ pure satda -- | Complete activity decision. --@@ -51,7 +51,7 @@ completeActivity = do let cweda = completeWorkflowExecutionDecisionAttributes decision CompleteWorkflowExecution- & dCompleteWorkflowExecutionDecisionAttributes .~ return cweda+ & dCompleteWorkflowExecutionDecisionAttributes .~ pure cweda -- | Cancel activity decision. --@@ -59,7 +59,7 @@ cancelActivity = do let cweda = cancelWorkflowExecutionDecisionAttributes decision CancelWorkflowExecution- & dCancelWorkflowExecutionDecisionAttributes .~ return cweda+ & dCancelWorkflowExecutionDecisionAttributes .~ pure cweda -- | Request to cancel activity decision. --@@ -67,14 +67,14 @@ requestCancel uid = do let rcatda = requestCancelActivityTaskDecisionAttributes (toText uid) decision RequestCancelActivityTask- & dRequestCancelActivityTaskDecisionAttributes .~ return rcatda+ & dRequestCancelActivityTaskDecisionAttributes .~ pure rcatda -- | Find a matching event type. -- findEvent :: MonadDecisionCtx c m => EventType -> m (Maybe HistoryEvent) findEvent eventType = do- let f [] = return Nothing- f (e:es) = bool (f es) (return $ Just e) $ e ^. heEventType == eventType+ let f [] = pure Nothing+ f (e:es) = bool (f es) (pure $ Just e) $ e ^. heEventType == eventType events <- view dcEvents f events @@ -86,7 +86,7 @@ uid <- liftIO nextRandom task <- view pActivityTask <$> view dcPlan let input = join $ view weseaInput <$> event ^. heWorkflowExecutionStartedEventAttributes- return [ scheduleActivity uid (task ^. tActivityType) (task ^. tTaskList) input ]+ pure [ scheduleActivity uid (task ^. tActivityType) (task ^. tTaskList) input ] -- | Cancel workflow step. --@@ -95,14 +95,14 @@ traceInfo "cancel" mempty event <- findEvent ActivityTaskScheduled let uid = join $ fromText . view atseaActivityId <$> join (view heActivityTaskScheduledEventAttributes <$> event)- return [ maybe cancelActivity requestCancel uid ]+ pure [ maybe cancelActivity requestCancel uid ] -- | Completed workflow step. -- completed :: MonadDecisionCtx c m => m [Decision] completed = do traceInfo "completed" mempty- return [ completeActivity ]+ pure [ completeActivity ] -- | Restart workflow step. --@@ -113,14 +113,14 @@ task <- view pActivityTask <$> view dcPlan event <- findEvent WorkflowExecutionStarted let input = join $ view weseaInput <$> join (view heWorkflowExecutionStartedEventAttributes <$> event)- return [ scheduleActivity uid (task ^. tActivityType) (task ^. tTaskList) input ]+ pure [ scheduleActivity uid (task ^. tActivityType) (task ^. tTaskList) input ] -- | Cancel failed workflow step. -- canceled :: MonadDecisionCtx c m => m [Decision] canceled = do traceInfo "canceled" mempty- return [ cancelActivity ]+ pure [ cancelActivity ] -- | When we run out of events. --@@ -128,7 +128,7 @@ nothing = do events <- view dcEvents traceError "none" [ "events" .= (textShow . view heEventType <$> events) ]- return mempty+ pure mempty -- | Schedule decision based on history events. --