Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function for checking async consumer event queue size #518

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ssams
Copy link
Contributor

@ssams ssams commented Oct 7, 2024

This adds a function consumer_events_available() on the async client to get the number of events available for consumption. Similar to e558946 I've added a default impl to the interface to avoid breaking old code which inherits from it.

The idea behind this is to allow exposing some stats in metrics, i.e. to see when consumers are lagging behind in consuming/processing messages, and the "pending" event count goes up. It may be also useful in some scenarios when implementing polling consumers, although I expect that in most cases the existing try_consume... functions are still more appropriate there.

Signed-off-by: Sebastian Sams <sebastian.sams@bestsolution.at>
@fpagliughi
Copy link
Contributor

Good idea. One minor nit.

@ssams
Copy link
Contributor Author

ssams commented Oct 8, 2024

One minor nit.

If you're referring to the failed check, that seems to be some (temporary?) error in the Mosquitto installation before the actual build - I don't think I can rerun the check myself though? At least I couldn't find one so far...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants