Hi Alex, thanks for your efforts and the update.

I have a few questions about promise-chan if you have a moment.

Firstly, why provide promise-chan rather than requiring (chan 
(buffers/promise)). The buffer provides the promise semantics and we don't 
similarly have sliding-chan, dropping-chan, etc. Is this an effort to 
delineate channels with promise-buffers from the vanilla variety?

Secondly, I've perhaps mistakenly considered channels more as a conduit 
between processes rather than a replacement for single assignment message 
passing. I get the value of using a channel and the core.async state 
machine for achieving promise-like semantics in a non-blocking way, and I 
can achieve that for a single consumer with a normal channel, the rub is 
this new buffer allows repeated consumption of a single value, and my 
previous understanding of channel semantics 'a channel will return nil when 
it is closed after some number of takes' no longer holds in all cases, 
because a promise-buffer is never exhausted.

Practically I'm sure I'll always be aware of the buffer-flavour of a 
channel that I'm using, but now we have a variety of channels for which 
many channel operations do not make sense, i.e.:

(async/go
  (prn "result" (async/<! (async/into [] some-chan)))

Am I right in suggesting a promise-channel is not really a channel, it's a 
promise masquerading as a channel because of the value of having the state 
machine as the mechanism of resolving assignment. This is clearly a welcome 
addition, perhaps my understanding of channel semantics needs an upgrade.

On Thursday, October 29, 2015 at 10:06:41 AM UTC+13, Alex Miller wrote:
>
> I am happy to announce a long-overdue core.async release.
>
> Dependency info:  [org.clojure/core.async "0.2.371"]
>
> There are a few new features in this release:
>
> 1) *promise-chan* is a function that returns a new kind of channel (with 
> a custom buffer) with promise semantics. Specifically, channels make a 
> one-time transition to having a deliverable value. *promise-chan* takes 
> an optional transducer, and an optional exception-handler (like chan). A 
> promise channel can take exactly one value that consumers will receive. 
> Once full, puts complete but val is dropped (no transfer).
> Consumers will block until either a value is placed in the channel or the 
> channel is closed (and nil will be delivered). 
>
> 2) *offer!* and *poll!* are two new non-blocking functions available on 
> channels.
>
> offer! puts a val into a channel if it can do so immediately and will 
> never block. Returns true if offer succeeds.
> poll! takes a val from a channel if it can do so immediately and will 
> never block. Return a value if successful, nil otherwise.
>
> All changes:
>
>    - ASYNC-103 <http://dev.clojure.org/jira/browse/ASYNC-103> - NEW 
>    promise-chan
>    - ASYNC-104 <http://dev.clojure.org/jira/browse/ASYNC-104> - NEW 
>    non-blocking offer!, poll!
>    - ASYNC-124 <http://dev.clojure.org/jira/browse/ASYNC-124> - dispatch 
>    multiple pending takers resulting from expanding transducer
>    - ASYNC-101 <http://dev.clojure.org/jira/browse/ASYNC-101> - 
>    async/reduce now respects reduced
>    - ASYNC-112 <http://dev.clojure.org/jira/browse/ASYNC-112> - replace 
>    "transformer" with "transducer" in deprecation messages
>    - ASYNC-6 <http://dev.clojure.org/jira/browse/ASYNC-6> - alts! docs 
>    updated to explicitly state ports is a vector
>    - Support (try (catch :default)) in CLJS exception handling
>    - Use cljs.test
>    - Updated tools.analyzer.jvm version (and other upstream deps) - fixes 
>    various analyzer errors
>
>
>

-- 
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/d/optout.

Reply via email to