summaryrefslogtreecommitdiff
path: root/Run
diff options
context:
space:
mode:
Diffstat (limited to 'Run')
-rw-r--r--Run/Que/Server.hs15
1 files changed, 3 insertions, 12 deletions
diff --git a/Run/Que/Server.hs b/Run/Que/Server.hs
index 69af529..e5094cd 100644
--- a/Run/Que/Server.hs
+++ b/Run/Que/Server.hs
@@ -96,7 +96,7 @@ routes = do
case poll of
True -> Scotty.stream $ streamQue q
_ -> do
- r <- liftIO <| takeQue q
+ r <- liftIO <| Go.read q
Scotty.html <| fromStrict <| Encoding.decodeUtf8 r
-- | POST que
@@ -119,7 +119,7 @@ routes = do
app . modify <| upsertNamespace ns
q <- app <| que ns qp
qdata <- Scotty.body
- liftIO <| pushQue (BSL.toStrict qdata) q
+ liftIO <| Go.write q <| BSL.toStrict qdata
return ()
-- | Given `guardNs ns whitelist`, if `ns` is not in the `whitelist`
@@ -222,15 +222,6 @@ que ns qp = do
if queExists
then return <| grab qp qbase
else do
- c <- liftIO Go.chan
+ c <- liftIO <| Go.chan 5
modify (insertQue ns qp c)
gets ques /> grab ns /> grab qp
-
--- | Put data on the que.
-pushQue :: Quedata -> Que -> IO ()
-pushQue = flip Go.write
-
--- | Tap and read from the Que. Tap first because a Que is actually a
--- broadcast channel. This allows for multiconsumer Ques.
-takeQue :: Que -> IO Quedata
-takeQue ch = Go.mult ch >>= Go.tap