I assume this is a pretty reliable way:

(:require [clojure.core.async.impl.protocols :refer [closed?]])

(closed? a-chan)

On Thursday, October 29, 2015 at 2:07:00 PM UTC-7, Lucas Bradstreet wrote:
>
> Fantastic release. I've been waiting for poll! and offer! for a while. 
>
> What is the recommended way to check whether a channel is closed? 
> Previously if the channel returned nil, then we know the channel is 
> closed, however with poll! we can't tell between the channel being 
> closed or just empty. 
>
> Thanks again, 
>
> Lucas 
>
> On 29 October 2015 at 05:06, Alex Miller <al...@puredanger.com 
> <javascript:>> 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 - NEW promise-chan 
> > ASYNC-104 - NEW non-blocking offer!, poll! 
> > ASYNC-124 - dispatch multiple pending takers resulting from expanding 
> > transducer 
> > ASYNC-101 - async/reduce now respects reduced 
> > ASYNC-112 - replace "transformer" with "transducer" in deprecation 
> messages 
> > 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 clo...@googlegroups.com 
> <javascript:> 
> > Note that posts from new members are moderated - please be patient with 
> your 
> > first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com <javascript:> 
> > 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+u...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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