I second the request to add a "count" field to the channel protocol.

I also agree that having to keep track of the buffer just to get the count
is hacky-ish.


On Thu, Jan 16, 2014 at 3:29 PM, Paul Viola <vi...@highspot.com> wrote:

>
> Still finding my way around Clojure... sorry if this is trivial.
>
> I am using core.async to implement a queue for a collection of workers
> that pull jobs and complete them (there may be multiple producers as well).
>
> All looks great so far.   Except when it comes time to close down the pipe
> (and drain if possible).
>
> I don't see a good way to get the number of items in a channel.  I could
> construct the fixedbuffer explicitly and then keep a hold on it...  but
> this feels non-idiomatic (the buffer is mutated at a distance by operations
> on the channel).
>
> Why not add a count operation to the channel??  It also seems useful for
> getting status information about the overall process (what is the average
> depth??).
>
> Happy to be educated.
>
> Thanks,
> Paul
>
>  --
> --
> 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.
>

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