From 9d8f762265794fae0f16adda4f109f66088fd374 Mon Sep 17 00:00:00 2001 From: Jens Nolte <jens@nightmarestudio.de> Date: Thu, 28 Nov 2019 04:19:05 +0100 Subject: [PATCH] Add comment --- src/QBar/Core.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/QBar/Core.hs b/src/QBar/Core.hs index b782986..6c7a7bf 100644 --- a/src/QBar/Core.hs +++ b/src/QBar/Core.hs @@ -320,8 +320,8 @@ cachePushBlock barUpdateChannel (PushBlockProducer blockProducer) = CachedBlockP atomically seal sendOutputToMailbox :: Output BlockOutput -> BlockOutput -> Effect IO () sendOutputToMailbox output blockOutput = lift $ do - -- The void discarding the boolean result that indicates if the mailbox is sealed - -- This is ok because right now once started a cached block never stops generating output and the mailbox is never sealed + -- The void is discarding the boolean result that indicates if the mailbox is sealed + -- This is ok because a cached block is never sealed from the receiving side atomically $ void $ send output blockOutput updateBar barUpdateChannel @@ -329,6 +329,7 @@ blockToCachedBlockProducer :: BarUpdateChannel -> Block -> CachedBlockProducer blockToCachedBlockProducer barUpdateChannel (PushBlock pushBlockProducer) = cachePushBlock barUpdateChannel pushBlockProducer blockToCachedBlockProducer _ (CachedBlock cachedBlockProducer) = cachedBlockProducer +-- |The '>!>'-operator can be used to apply a 'Pipe' to the 'BlockProducer' contained in the 'Block'. (>!>) :: Block -> Pipe BlockOutput BlockOutput IO () -> Block (>!>) (PushBlock (PushBlockProducer blockProducer)) pipe = pushBlock $ (blockProducer >-> pipe) (>!>) (CachedBlock (CachedBlockProducer blockProducer)) pipe = cachedBlock $ (blockProducer >-> pipe) -- GitLab