From 414c438d17a3e540be0c930365d3048ca5635332 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 15 Apr 2020 22:49:19 -0700 Subject: 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. --- Que/Server.hs | 5 ++--- 1 file 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. -- cgit v1.2.3