Skip to content

Add Async::Condition#waiting_count #455

@rmosolgo

Description

@rmosolgo

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions