Query for cardinality in buffered core.async / chan
1 answer
A specific channel is of type ManyToManyChannel
, you can access the internal buffer for a channel using the property buf
.
(.buf c) => #<FixedBuffer clojure.core.async.impl.buffers.FixedBuffer@3d67452c>
This buffer implements clojure.lang.Counted
, so it is countable.
(count (.buf c))
=> 0
+5
source to share