summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Com/Simatime/Go.hs6
-rw-r--r--Run/Que/Server.hs4
2 files changed, 5 insertions, 5 deletions
diff --git a/Com/Simatime/Go.hs b/Com/Simatime/Go.hs
index f19511f..9ea2896 100644
--- a/Com/Simatime/Go.hs
+++ b/Com/Simatime/Go.hs
@@ -71,9 +71,9 @@ tap = Chan.readChan
read :: Channel a -> IO a
read = Chan.readChan . _out
--- | Write to a channel.
-write :: Channel a -> a -> IO ()
-write = Chan.writeChan . _in
+-- | Write to a channel. Blocks if the channel is full.
+write :: Channel a -> a -> IO Bool
+write = Chan.tryWriteChan . _in
{- $example
diff --git a/Run/Que/Server.hs b/Run/Que/Server.hs
index 792676d..70bc559 100644
--- a/Run/Que/Server.hs
+++ b/Run/Que/Server.hs
@@ -147,7 +147,7 @@ routes = do
app . modify <| upsertNamespace ns
q <- app <| que ns qp
qdata <- Scotty.body
- liftIO <| Go.write q <| BSL.toStrict qdata
+ _ <- liftIO <| Go.write q <| BSL.toStrict qdata
return ()
-- | Given `guardNs ns whitelist`, if `ns` is not in the `whitelist`
@@ -229,6 +229,6 @@ que ns qp = do
if queExists
then return <| grab qp qbase
else do
- c <- liftIO <| Go.chan 5
+ c <- liftIO <| Go.chan 1
modify (insertQue ns qp c)
gets ques /> grab ns /> grab qp