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

Merged
merged 1 commit into from
Oct 22, 2024
Merged

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.

@BewareMyPower BewareMyPower merged commit 715411c into master Oct 22, 2024
5 checks passed
@BewareMyPower BewareMyPower deleted the cs/fix_flow_math branch October 22, 2024 12:34
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