zio / zio-http

A next-generation Scala framework for building scalable, correct, and efficient HTTP clients and servers
https://zio.dev/zio-http
Apache License 2.0
787 stars 396 forks source link

Support receiving `ServerSentEvents` in the (Endpoint) client #2953

Closed 987Nabil closed 2 months ago

987Nabil commented 3 months ago

Currently users can sent SSE with zio-http but not receive them. We should make this possible. For the Endpoint API as well as for the low level API. This means we need a way to decode an incoming stream of data to an SSE and integrate this in Response as well as in the EndpointAPI

kyri-petrou commented 3 months ago

Excuse my ignorance, but is client-sent SSE a thing? I thought SSE was meant to be the server sending back events in response to a text/event-stream request 🤔 I also can't find any reference to it anywhere

987Nabil commented 3 months ago

But where is the server sending the events too? The client. And we need to be able to read them, no? Why should we not have parser logic that generates instances of ServerSentEvent in the Endpoint API client?

kyri-petrou commented 3 months ago

🤦‍♂️ I read the issue as "the server being able to receive SSE from a client"

jdegoes commented 2 months ago

/bounty $400 but has to come quickly due to final release.

algora-pbc[bot] commented 2 months ago

💎 $400 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #2953 with your implementation plan
  2. Submit work: Create a pull request including /claim #2953 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
🟢 @987Nabil #2987
algora-pbc[bot] commented 2 months ago

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

algora-pbc[bot] commented 2 months ago

🎉🎈 @987Nabil has been awarded $400! 🎈🎊