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 a hybrid RequestStreaming option that streams requests only if they're larger than X bytes #2908

Open
kyri-petrou opened this issue Jun 14, 2024 · 6 comments
Labels
💎 Bounty enhancement New feature or request

Comments

@kyri-petrou
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently, zio-http provides 2 config options for RequestStreaming:

  1. Disabled (with a maximum number of bytes that the request can be before rejecting it)
  2. Enabled (requests are streamed regardless of size)

For servers with low latency / high performance requirements, disabling streaming is a favourable option as it's more performant than streaming the requests. However, in some cases we might want to be able to be able to handle very large requests, so it would be good if zio-http provided an option to aggregate the response if it's less than X bytes, and stream it if it's larger than that

Describe the solution you'd like
Another case class extending RequestStreaming similar to Disabled but instead of failing the request it streams the bytes instead

Describe alternatives you've considered
Enabling streaming and using a middleware to batch the ZStream, but this doesn't perform as well as I would have hoped

@kyri-petrou kyri-petrou added the enhancement New feature or request label Jun 14, 2024
@jdegoes
Copy link
Member

jdegoes commented Jul 30, 2024

/bounty $250 but has to ship soon because of final release coming up.

Copy link

algora-pbc bot commented Jul 30, 2024

💎 $250 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #2908 with your implementation plan
  2. Submit work: Create a pull request including /claim #2908 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-http!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🔴 @abhi267266 Aug 3, 2024, 9:26:19 AM WIP
🟢 @Ahmadkhan02 Aug 4, 2024, 8:48:55 PM #3003

@abhi267266
Copy link

abhi267266 commented Aug 3, 2024

/attempt #2908

@Ahmadkhan02
Copy link

Ahmadkhan02 commented Aug 4, 2024

/attempt #2908

Algora profile Completed bounties Tech Active attempts Options
@Ahmadkhan02 1 bounty from 1 project
TypeScript, Jupyter Notebook
Cancel attempt

Copy link

algora-pbc bot commented Aug 4, 2024

Note

The user @abhi267266 is already attempting to complete issue #2908 and claim the bounty. We recommend checking in on @abhi267266's progress, and potentially collaborating, before starting a new solution.

Copy link

algora-pbc bot commented Aug 4, 2024

💡 @Ahmadkhan02 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Ahmadkhan02 added a commit to Ahmadkhan02/zio-http that referenced this issue Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants