-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add ZPipeline::mapChunksEither
#9775
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
Conversation
f6637a1 to
6b72413
Compare
| lazy val reader: ZChannel[Env, Err, Chunk[In], Any, Err, Chunk[Out], Any] = | ||
| ZChannel.readWithCause( | ||
| chunk => { | ||
| if (chunk.isEmpty) reader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not actually sure this is the correct behaviour. The user might want to deal with the "empty chunk" case and decide to return a Left or Right in this case, no? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it even possible to have an empty chunk? If so we should definitely pass it to f(_), which means that either way we shouldn't handle .isEmpty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it even possible to have an empty chunk?
This is a good question. I don't know.
I made the change
859ff38 to
c9745c8
Compare
streams-tests/shared/src/test/scala/zio/stream/ZPipelineSpec.scala
Outdated
Show resolved
Hide resolved
streams-tests/shared/src/test/scala/zio/stream/ZPipelineSpec.scala
Outdated
Show resolved
Hide resolved
…cala Co-authored-by: Adam Hearn <[email protected]>
…cala Co-authored-by: Adam Hearn <[email protected]>
|
@hearnadam I need another approval as I merged your suggestions 😅 |
No description provided.