summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-04-15 22:49:19 -0700
committerBen Sima <ben@bsima.me>2020-04-15 22:49:19 -0700
commit414c438d17a3e540be0c930365d3048ca5635332 (patch)
treed4911fe87cb3019affe6299309a0ca19d20c2f93
parent2c633335249d4d586ed09ee0955b09da603b6921 (diff)
Don't mult and tap when streaming a que
This removes the multi style, but that was buggy. I think messages were being lost when consumers detached and mult channels disappeared, or something. I'll need to reimplement muilti style properly, with tests.
-rw-r--r--Que/Server.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Que/Server.hs b/Que/Server.hs
index 9e8d893..5287c02 100644
--- a/Que/Server.hs
+++ b/Que/Server.hs
@@ -186,12 +186,11 @@ guardNs ns whitelist = when (not <| ns `elem` whitelist) <| do
-- | Forever write the data from 'Que' to 'Wai.StreamingBody'.
streamQue :: Que -> Wai.StreamingBody
-streamQue q write _ = Go.mult q >>= loop
+streamQue q write _ = loop q
where
loop c =
- Go.tap c
+ Go.read c
>>= (write . Builder.byteStringInsert)
- >> (write <| Builder.byteStringInsert "\n")
>> loop c
-- | Gets the thing from the Hashmap. Call's 'error' if key doesn't exist.