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

Ember stream forking #4244

Merged
merged 15 commits into from Jan 28, 2021
Merged

Conversation

RaasAhsan
Copy link
Member

@RaasAhsan RaasAhsan commented Jan 23, 2021

Follow up to #4179. I introduced a prefetch call which is a hack to get the outer stream to terminate and finalize before inner streams do, by buffering streams to a new stream. parJoin also shuffles the results of the inner stream back out to the new stream which isn't strictly necessary.

This PR introduces a forking combinator which behaves identically to parJoin except the outer stream can terminate and finalize before the inner stream, and there is no queueing involved.

TODO:

  • Concurrency control
  • Possibly upstream this back into fs2, since it's useful for network servers in general

@rossabaker rossabaker added this to To do in Cats Effect 3 via automation Jan 24, 2021
@RaasAhsan RaasAhsan marked this pull request as ready for review January 24, 2021 07:31
@RaasAhsan
Copy link
Member Author

@rossabaker if you encounter any issues merging downstream, definitely ping me to help, but I don't anticipate there being any trouble

@RaasAhsan RaasAhsan changed the base branch from main to series/0.21 January 27, 2021 03:13
Copy link
Member

@ChristopherDavenport ChristopherDavenport left a comment

Choose a reason for hiding this comment

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

We can contribute this to fs2?

@SystemFw
Copy link
Member

We can contribute this to fs2?

it's extremely dangerous in the general case :)

@rossabaker rossabaker merged commit c04dadf into http4s:series/0.21 Jan 28, 2021
Cats Effect 3 automation moved this from To do to Done Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants