Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Allow streaming responses via zio.stream.Stream #269

Merged
merged 1 commit into from
Sep 23, 2020

Conversation

nightscape
Copy link
Contributor

This PR adds the capability to specify streaming responses via zio.stream.Stream.
I am positively shocked that this actually works!! 😮
Am I missing something?

This would fix the specific use case mentioned in #268

case Reset => UIO((0, ()))
case Increase => UIO((state + 1, ()))
case Get => UIO((state, state))
case IncreaseUpTo(upper) => UIO((upper, Stream.fromIterable(state until upper)))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a little suspicious: The state should probably evolve with the streamed response instead of directly jumping to the last value.

Copy link
Contributor

@softinio softinio left a comment

Choose a reason for hiding this comment

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

LGTM thanks for this

@softinio softinio merged commit dffd8d0 into zio-archive:master Sep 23, 2020
@nightscape nightscape deleted the response_streams branch September 23, 2020 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants