Skip to content

Conversation

@miguelgrinberg
Copy link
Contributor

This makes the queue used for the sync bulk helper equal in functionality to the ones we are using for asyncio and trio. An unbuffered queue makes more sense in this case because there is no benefit to accumulating all the elements in the queue faster than they can be processed.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

(As you know, there's one minor difference: the async queue max size is 0, meaning it's only possible to put something in it successfully if another task is trying to get an element. However, that's not possible with queue.Queue as 0 means unbounded. Still, that's a much better approximation.)

@miguelgrinberg miguelgrinberg merged commit 64f11cd into elastic:main Oct 28, 2025
15 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 28, 2025
@miguelgrinberg miguelgrinberg deleted the use-unbuffered-queue branch October 28, 2025 11:15
miguelgrinberg added a commit that referenced this pull request Oct 28, 2025
(cherry picked from commit 64f11cd)

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants