@@ -7,6 +7,7 @@ module Hakyll.Core.Compiler
77 , getIdentifier
88 , getRoute
99 , getResourceString
10+ , waitFor
1011 , require
1112 , requireAll
1213 , cached
@@ -82,6 +83,11 @@ getDependency identifier = CompilerM $ do
8283 ++ show identifier
8384 ++ " not found in the cache, the cache might be corrupted"
8485
86+-- | Wait until another compiler has finished before running this compiler
87+--
88+waitFor :: Identifier -> Compiler a a
89+waitFor = fromDependencies . const . return
90+
8591-- | Require another target. Using this function ensures automatic handling of
8692-- dependencies
8793--
@@ -90,7 +96,7 @@ require :: (Binary a, Typeable a, Writable a)
9096 -> (b -> a -> c)
9197 -> Compiler b c
9298require identifier f =
93− fromDependencies (const [identifier]) >>> fromJob require'
99+ waitFor identifier >>> fromJob require'
94100 where
95101 require' x = do
96102 y <- getDependency identifier