core.async - count mult

77 views
Skip to first unread message

Terje Dahl

unread,
Nov 21, 2015, 11:37:22 AM11/21/15
to Clojure
In addition to the function tap, untap, and untap-all I would like to propose a fourth function which returns a count of the number of target channels for a mult.
I would call it "cnt" (or perhaps "cnt-taps" or "count-taps"), but probably not "count", as that would step on clojure.core/count.

My use case is as follows:
I need one or more channels to recieve data from an audio input stream.  I have to continuously read from the stream and write the data to a mult. But I don't want to run this reader-loop if nothing is tapped to the mult.  So I would like to check the count and start or stop the loop based on the number of taps.

I have a patch ready to be submitted.  ;-)
Reply all
Reply to author
Forward
0 new messages