wolf 0.3.38 → 0.3.39
raw patch · 8 files changed
+34/−11 lines, 8 files
Files
- main/actor.hs +9/−0
- main/counter.hs +3/−0
- main/decider.hs +3/−0
- src/Network/AWS/Wolf/Act.hs +4/−4
- src/Network/AWS/Wolf/Count.hs +4/−3
- src/Network/AWS/Wolf/Decide.hs +4/−3
- src/Network/AWS/Wolf/Prelude.hs +6/−0
- wolf.cabal +1/−1
main/actor.hs view
@@ -16,6 +16,12 @@ -- ^ Configuration file. , quiesce :: Maybe FilePath -- ^ Optional quiesce file to stop actor.+ , domain :: Maybe Text+ -- ^ Optional domain to use.+ , bucket :: Maybe Text+ -- ^ Optional bucket to use.+ , prefix :: Maybe Text+ -- ^ Optional prefix to use. , queue :: Text -- ^ Queue to listen to act on. , num :: Maybe Int@@ -38,6 +44,9 @@ actMain (config args) (quiesce args)+ (domain args)+ (bucket args)+ (prefix args) (queue args) (fromMaybe 1 $ num args) (nocopy args)
main/counter.hs view
@@ -16,6 +16,8 @@ -- ^ Configuration file. , plan :: FilePath -- ^ Plan file to count on.+ , domain :: Maybe Text+ -- ^ Optional domain to use. } deriving (Show, Generic) instance ParseRecord Args@@ -28,3 +30,4 @@ countMain (config args) (plan args)+ (domain args)
main/decider.hs view
@@ -16,6 +16,8 @@ -- ^ Configuration file. , plan :: FilePath -- ^ Plan file to decide on.+ , domain :: Maybe Text+ -- ^ Optional domain to use. } deriving (Show, Generic) instance ParseRecord Args@@ -28,3 +30,4 @@ decideMain (config args) (plan args)+ (domain args)
src/Network/AWS/Wolf/Act.hs view
@@ -105,14 +105,14 @@ statsIncrement "wolf.act.activity.count" [ "queue" =. queue, "status" =. status ] statsHistogram "wolf.act.activity.elapsed" (realToFrac (diffUTCTime t3 t2) :: Double) [ "queue" =. queue ] - -- | Run actor from main with config file. ---actMain :: MonadControl m => FilePath -> Maybe FilePath -> Text -> Int -> Bool -> Bool -> String -> m ()-actMain cf quiesce queue num nocopy local command =+actMain :: MonadControl m => FilePath -> Maybe FilePath -> Maybe Text -> Maybe Text -> Maybe Text -> Text -> Int -> Bool -> Bool -> String -> m ()+actMain cf quiesce domain bucket prefix queue num nocopy local command = runCtx $ runTop $ do conf <- readYaml cf- runConfCtx conf $+ let conf' = override cPrefix prefix $ override cBucket bucket $ override cDomain domain conf+ runConfCtx conf' $ runConcurrent $ replicate num $ forever $ do ok <- check quiesce when ok $
src/Network/AWS/Wolf/Count.hs view
@@ -47,10 +47,11 @@ -- | Run counter from main with config file. ---countMain :: MonadControl m => FilePath -> FilePath -> m ()-countMain cf pf =+countMain :: MonadControl m => FilePath -> FilePath -> Maybe Text -> m ()+countMain cf pf domain = runCtx $ runTop $ do conf <- readYaml cf- runConfCtx conf $ do+ let conf' = override cDomain domain conf+ runConfCtx conf' $ do plans <- readYaml pf mapM_ count (plans :: [Plan])
src/Network/AWS/Wolf/Decide.hs view
@@ -110,11 +110,12 @@ -- | Run decider from main with config file. ---decideMain :: MonadControl m => FilePath -> FilePath -> m ()-decideMain cf pf =+decideMain :: MonadControl m => FilePath -> FilePath -> Maybe Text -> m ()+decideMain cf pf domain = runCtx $ runTop $ do conf <- readYaml cf- runConfCtx conf $ do+ let conf' = override cDomain domain conf+ runConfCtx conf' $ do plans <- readYaml pf runConcurrent $ forever . decide <$> plans
src/Network/AWS/Wolf/Prelude.hs view
@@ -7,6 +7,7 @@ module Network.AWS.Wolf.Prelude ( module Exports , runConcurrent+ , override ) where import Control.Concurrent.Async.Lifted@@ -16,3 +17,8 @@ -- runConcurrent :: MonadBaseControl IO m => [m a] -> m () runConcurrent = void . runConcurrently . traverse Concurrently++-- | Override a lens value with a maybe value.+--+override :: ASetter s s a b -> Maybe b -> s -> s+override k v c = maybe c (flip (set k) c) v
wolf.cabal view
@@ -1,5 +1,5 @@ name: wolf-version: 0.3.38+version: 0.3.39 synopsis: Amazon Simple Workflow Service Wrapper. description: Wolf is a wrapper around Amazon Simple Workflow Service. homepage: https://github.com/swift-nav/wolf