mirror of https://github.com/voidlizard/hbs2
wip, minor fix
This commit is contained in:
parent
ec7eea1ac6
commit
f6b756fd31
|
@ -343,10 +343,9 @@ ncqStorageRun2 :: forall m . MonadUnliftIO m
|
||||||
-> m ()
|
-> m ()
|
||||||
ncqStorageRun2 ncq@NCQStorage2{..} = flip runContT pure do
|
ncqStorageRun2 ncq@NCQStorage2{..} = flip runContT pure do
|
||||||
|
|
||||||
jobQ <- newTQueueIO
|
|
||||||
closeQ <- newTQueueIO
|
closeQ <- newTQueueIO
|
||||||
|
|
||||||
closer <- ContT $ withAsync $ liftIO $ fix \loop -> do
|
closer <- spawnActivity $ liftIO $ fix \loop -> do
|
||||||
what <- atomically do
|
what <- atomically do
|
||||||
stop <- readTVar ncqStorageStopReq
|
stop <- readTVar ncqStorageStopReq
|
||||||
tryReadTQueue closeQ >>= \case
|
tryReadTQueue closeQ >>= \case
|
||||||
|
@ -367,8 +366,6 @@ ncqStorageRun2 ncq@NCQStorage2{..} = flip runContT pure do
|
||||||
ncqAlterEntrySTM ncq (coerce k) (const Nothing)
|
ncqAlterEntrySTM ncq (coerce k) (const Nothing)
|
||||||
loop
|
loop
|
||||||
|
|
||||||
link closer
|
|
||||||
|
|
||||||
spawnActivity $ forever (liftIO $ join $ atomically (readTQueue ncqJobQ))
|
spawnActivity $ forever (liftIO $ join $ atomically (readTQueue ncqJobQ))
|
||||||
|
|
||||||
spawnActivity measureWPS
|
spawnActivity measureWPS
|
||||||
|
|
Loading…
Reference in New Issue