Hi! I've been expanding my use of Async in GraphQL-Ruby's AsyncDataloader and I have a use case for checking how many tasks are waiting for a given Async::Condition.
What do you think of adding Async::Condition#waiting_count, like Async::Queue#waiting_count? Under the hood, it would use the same Ruby Thread::Queue#num_waiting API, for example:
def waiting_count
@ready.num_waiting
end
If you like it, I'd be happy to open a PR with this method and some tests. Thanks!
Hi! I've been expanding my use of Async in GraphQL-Ruby's
AsyncDataloaderand I have a use case for checking how many tasks are waiting for a given Async::Condition.What do you think of adding
Async::Condition#waiting_count, likeAsync::Queue#waiting_count? Under the hood, it would use the same RubyThread::Queue#num_waitingAPI, for example:If you like it, I'd be happy to open a PR with this method and some tests. Thanks!