mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
Rename writeThread to sink.
This commit is contained in:
parent
e6bb7d6863
commit
3c0ed9029f
@ -127,7 +127,7 @@ distributeFoldMap toTask inputs = fmap fold (distribute (fmap toTask inputs))
|
|||||||
runTask :: Task a -> IO a
|
runTask :: Task a -> IO a
|
||||||
runTask task = do
|
runTask task = do
|
||||||
logQueue <- newTMQueueIO
|
logQueue <- newTMQueueIO
|
||||||
logging <- async (writeThread logQueue)
|
logging <- async (sink logQueue)
|
||||||
|
|
||||||
result <- runFreerM (\ task -> case task of
|
result <- runFreerM (\ task -> case task of
|
||||||
ReadBlobs source -> pure <$ writeLog (Info "ReadBlobs") <*> either Files.readBlobsFromHandle (traverse (uncurry Files.readFile)) source
|
ReadBlobs source -> pure <$ writeLog (Info "ReadBlobs") <*> either Files.readBlobsFromHandle (traverse (uncurry Files.readFile)) source
|
||||||
@ -144,12 +144,12 @@ runTask task = do
|
|||||||
atomically (closeTMQueue logQueue)
|
atomically (closeTMQueue logQueue)
|
||||||
wait logging
|
wait logging
|
||||||
pure result
|
pure result
|
||||||
where writeThread queue = do
|
where sink queue = do
|
||||||
message <- atomically (readTMQueue queue)
|
message <- atomically (readTMQueue queue)
|
||||||
case message of
|
case message of
|
||||||
Just message -> do
|
Just message -> do
|
||||||
B.hPutStr stderr (formatMessage message)
|
B.hPutStr stderr (formatMessage message)
|
||||||
writeThread queue
|
sink queue
|
||||||
_ -> pure ()
|
_ -> pure ()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user