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

Stream body with environmentment access or scope #2817

Open
guersam opened this issue May 2, 2024 · 2 comments
Open

Stream body with environmentment access or scope #2817

guersam opened this issue May 2, 2024 · 2 comments
Labels
💎 Bounty enhancement New feature or request

Comments

@guersam
Copy link
Contributor

guersam commented May 2, 2024

Currently Body.fromStream* and Response.fromServerSentEvents fix the R type of the output stream to be Any. It blocks or makes difficult to implement some use cases such as:

  • A Server Sent Event response stream might want access internal modules via environment.
  • Use a resourceful ZIO effect with a stream body, i.e. A temporary file RIO[Scope, File] that should be deleted after the stream terminates.

There are some workarounds like ZIO.environmentWith(stream.provideEnvironment), but it does not go well with Scope because the stream outlives the handler in the current design.

@guersam guersam added the enhancement New feature or request label May 2, 2024
@jdegoes
Copy link
Member

jdegoes commented Jun 5, 2024

/bounty $150

Copy link

algora-pbc bot commented Jun 5, 2024

💎 $150 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #2817 with your implementation plan
  2. Submit work: Create a pull request including /claim #2817 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

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

2 participants