Core async pipeline should return to channel.

2015-04-17 Thread Claudius Nicolae
Since issue tracker for core.async is disabled on github, I'll spill this 
here.
I think pipeline should return the to channel, to make it 
threading-friendly:

(- (range 100)
   (a/to-chan)
   (a/pipeline 10 (a/chan) (map inc))
   (a/pipeline 2 (a/chan) (filter odd?)))

Currently return value is incidental.

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


Re: Core async pipeline should return to channel.

2015-04-17 Thread Francis Avila
Core.async issues are reported on Clojure's 
JIRA: http://dev.clojure.org/jira/browse/ASYNC

pipeline does not have an incidental return value: it returns a channel 
which closes when there are no more transformation results, i.e. when the 
pipelining process is finished. There is no other way to get this 
information, especially when close? is false.

You're right this hurts threading, but sometimes you do need to monitor 
when pipelining is done. In fact, the pipe function does return the to 
channel like you suggest, and I had to write my own version that returned 
its inner go-loop because I needed to monitor the piping 
process. 
https://gist.github.com/favila/8e7ad6ea5b01bd7466ff#file-async-util-clj-L27


On Friday, April 17, 2015 at 2:33:58 PM UTC-5, Claudius Nicolae wrote:

 Since issue tracker for core.async is disabled on github, I'll spill this 
 here.
 I think pipeline should return the to channel, to make it 
 threading-friendly:

 (- (range 100)
(a/to-chan)
(a/pipeline 10 (a/chan) (map inc))
(a/pipeline 2 (a/chan) (filter odd?)))

 Currently return value is incidental.


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