I'm looking for some feedback on recent changes Rich and I have made to
core.async:

I merged the "put ret" branch into master of core.async. This commit
introduces some changes to the core.async API that provides feedback during
a put! operation.

The changes to the public api are fairly simple:

(let [result (put! c 42 (fn [result] nil))]
  nil)

In this snippet, both result variables (in the callback and in the return
value) will return true, unless the channel is already closed. Since this
value is propagated to >! as well, termination of writers is now fairly
easy:

(loop [x 0]
  (when (>! c x)
    (recur (inc x))))

Note: these new semantics don't change how pending puts are handled when a
channel closes. So if a put! returns true, the callback will not later be
called with false if the channel is closed. Once a put operation is
enqueued it will stay enqueued until a taker removes the operation. Close!
will still not remove pending puts.

WARNING!!! The inclusion of these changes means we have to break the public
API. The function handed to put! now takes one argument instead of zero
arguments. This will instantly break any code that uses put!. Therefore
when upgrading to 0.1.0-SNAPSHOT you will need to update all calls to put!.
I'm sorry about this, but there's really no other way to get these changes
into the api.

Please let me know about any bugs you find in the current 0.1.0-SNAPSHOT.

Thanks,

Timothy Baldridge

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to