propellor spin

This commit is contained in:
Joey Hess 2015-01-05 19:42:59 -04:00
parent 208322d5be
commit bd7c118cae
Failed to extract signature
1 changed files with 6 additions and 1 deletions

View File

@ -42,6 +42,10 @@ fromMarked marker s
sendMarked :: Handle -> Marker -> String -> IO () sendMarked :: Handle -> Marker -> String -> IO ()
sendMarked h marker s = do sendMarked h marker s = do
debug ["sent marked", marker] debug ["sent marked", marker]
sendMarked' h marker s
sendMarked' :: Handle -> Marker -> String -> IO ()
sendMarked' h marker s = do
-- Prefix string with newline because sometimes a -- Prefix string with newline because sometimes a
-- incomplete line has been output, and the marker needs to -- incomplete line has been output, and the marker needs to
-- come at the start of a line. -- come at the start of a line.
@ -63,5 +67,6 @@ getMarked h marker = go =<< catchMaybeIO (hGetLine h)
req :: Stage -> Marker -> (String -> IO ()) -> IO () req :: Stage -> Marker -> (String -> IO ()) -> IO ()
req stage marker a = do req stage marker a = do
sendMarked stdout statusMarker (show stage) debug ["requested marked", marker]
sendMarked' stdout statusMarker (show stage)
maybe noop a =<< getMarked stdin marker maybe noop a =<< getMarked stdin marker