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

Support flow messages for batch size of 1 #326

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

Conversation

stearnsc
Copy link
Collaborator

@stearnsc stearnsc commented Oct 9, 2024

The logic for when to send a flow message is currently "if there are fewer outstanding messages than half the batch size, request more" (if self.remaining_messages < self.batch_size / 2). If batch_size is set to 1, this will never run, and the consumer will only ever receive the initial message.

By using div_ceil here, we guarantee that when remaining_messages is 0, the consumer will ask for the next message.

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