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

Allow custom queuing strategy for event streams #442

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

adam-of-barot
Copy link
Contributor

Functionality

Adds ability to use a user-defined queuing strategy for eventStream().

Reason for this PR

The default queuing strategy can apparently cause memory issues server-side due to backpressure, even for the most simplest of cases.

Issues tested with code from this blog post.

The internal queue of the ReadableStream is never getting fully cleared out, and is steadily consuming more memory with each send() call.

After adjusting the queuing strategy to new CountQueuingStartegy({ highWaterMark: 2 }), the memory issues stopped.

@sergiodxa sergiodxa added the enhancement New feature or request label Jan 20, 2025
@sergiodxa sergiodxa merged commit 3d24bda into sergiodxa:main Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants