loup 0.0.8 → 0.0.9
raw patch · 2 files changed
+7/−6 lines, 2 files
Files
- loup.cabal +1/−1
- src/Network/AWS/Loup/Act.hs +6/−5
loup.cabal view
@@ -1,5 +1,5 @@ name: loup-version: 0.0.8+version: 0.0.9 synopsis: Amazon Simple Workflow Service Wrapper for Work Pools. description: Loup is a wrapper around Amazon Simple Workflow Service for Work Pools. homepage: https://github.com/swift-nav/loup
src/Network/AWS/Loup/Act.hs view
@@ -75,24 +75,25 @@ -- | Run command with input. ---runActivity :: MonadStatsCtx c m => Bool -> Text -> Text -> Maybe Value -> m ()-runActivity copy command token input = do+runActivity :: MonadStatsCtx c m => Bool -> Text -> Maybe Value -> m ()+runActivity copy command input = do traceInfo "run" [ "command" .= command, "input" .= input ] intempdir copy $ do liftIO $ maybe_ input $ encodeFile "input.json" stderr $ inshell command mempty- failActivity token -- | Actor logic - poll for work, download artifacts, run command, upload artifacts. ---activity :: (MonadStatsCtx c m, FromJSON a) => Text -> Text -> Int -> (Text -> Maybe a -> m b) -> m ()+activity :: (MonadStatsCtx c m, FromJSON a) => Text -> Text -> Int -> (Maybe a -> m b) -> m () activity domain queue interval action = do traceInfo "poll" mempty (token, input) <- pollActivity domain (taskList queue) maybe_ token $ \token' -> do traceInfo "start" mempty let input' = join $ decode . encodeUtf8 <$> input- race_ (runHeartbeat token' interval) (action token' input')+ race_ (runHeartbeat token' interval) $ do+ void $ action input'+ failActivity token' traceInfo "finish" mempty -- | Activity setup fom main.