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 Backlog method signature to Consumer interface #98

Merged
merged 5 commits into from
Jun 10, 2018
Merged

Conversation

JeanMertz
Copy link
Contributor

This allows for processors to determine their mode of operation, based on the messages still waiting to be consumed.

For example, if a processor continuously consumes messages, and periodically produces messages based on the previously consumed messages, it might be desired to have the producer only trigger if the backlog of the consumer is small enough. This allows for dynamically catching up with a larger backlog during peak-hours.

The method signature is straightforward:

Backlog() (int, error)

Stream client implementations that have no concept of message persistence or consumer identity, always return 0. The error will be non-nil if any error occurred while fetching the required data.

@JeanMertz JeanMertz merged commit 61eb3bb into master Jun 10, 2018
@JeanMertz JeanMertz deleted the backlog-query branch June 10, 2018 17:06
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.

1 participant