diff options
author | Ben Sima <ben@bsima.me> | 2020-04-11 00:58:03 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-04-11 01:00:52 -0700 |
commit | 3c56301c1d18417dba2f7e6cab8a0e543d0f1c9e (patch) | |
tree | ed23657923eee290d5858926314e757c4fe61d68 /Com | |
parent | 876d0b1abc63754daba58c60c1ecdc2b4802d3bc (diff) |
Bound ques to 1 element
Also *really* block on writes.
Diffstat (limited to 'Com')
-rw-r--r-- | Com/Simatime/Go.hs | 6 |
1 files changed, 3 insertions, 3 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 |