# Getting the length of remote channels

**URL:** <https://discourse.julialang.org/t/getting-the-length-of-remote-channels/76554>\
**Category:** Julia at Scale\
**Tags:** question\
**Created:** [February 16, 2022, 12:14pm UTC](https://discourse.julialang.org/t/getting-the-length-of-remote-channels/76554 "2022-02-16T12:14:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RogerP](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rogerp/32/17496_2.png) [@RogerP](https://discourse.julialang.org/u/RogerP)\
**Post date:** [February 16, 2022, 12:14pm UTC](https://discourse.julialang.org/t/getting-the-length-of-remote-channels/76554/1 "2022-02-16T12:14:53Z")

</div>

A somewhat similar question to this was raised here [Channel Monitoring Statistics](https://discourse.julialang.org/t/channel-monitoring-statistics/53744/3). I want to use remote channels as if they were regular buffers, e.g. Circular Buffers from [DataStructures.jl](https://juliacollections.github.io/DataStructures.jl/latest/), however those are difficult to share between workers without a lot of function calls, copying and memory overhead. I use RemoteChannels because they are naturally shared and reference-able, and are a form of buffer.

I simply need to know how many objects are in each remote channel because I only wish to start taking data when my channel is full. `isready()` returns true when there is only one object in the channel, which is no good to me. I need an `isfull()` method, or better still a `length()` method. Does anyone know how to do this? (I realise I can count them using `take!()` until `isready = false` and then put them all back, but I need to check the length millions of times a second across about 50 channels.)

Edit: My use case is a pseudo real-time monitoring and control system where I am taking many measurements from a dynamical system and need to have a simple noise filter across e.g. 50 streams of data and the filter requires me to store state but I can never know which measurement will be sampled next, so that I need to choose the appropriate buffer/channel for that data stream each time.
