mirror of https://github.com/voidlizard/hbs2
wip, okay
This commit is contained in:
parent
e5ad42b2a3
commit
cefdff1aa0
|
@ -33,13 +33,22 @@ glob pat ignore dir action = do
|
||||||
|
|
||||||
q <- newTQueueIO
|
q <- newTQueueIO
|
||||||
|
|
||||||
w <- liftIO (async $ go q dir >> atomically (writeTQueue q Nothing))
|
void $ liftIO (async $ go q dir >> atomically (writeTQueue q Nothing))
|
||||||
|
|
||||||
|
flip runContT pure do
|
||||||
|
callCC \exit -> do
|
||||||
fix $ \next -> do
|
fix $ \next -> do
|
||||||
e <- atomically (readTQueue q)
|
e <- atomically do
|
||||||
case e of
|
void (peekTQueue q)
|
||||||
Nothing -> pure ()
|
STM.flushTQueue q
|
||||||
Just x -> void (action x) >> next
|
|
||||||
|
for_ e $ \case
|
||||||
|
Nothing -> exit ()
|
||||||
|
Just x -> do
|
||||||
|
r <- lift (action x)
|
||||||
|
unless r (exit ())
|
||||||
|
|
||||||
|
next
|
||||||
|
|
||||||
where
|
where
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue