Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adamgfraser
Copy link
Contributor

Allows creating a pipeline from a stream transformation function so you can do with a pipeline anything you can do with a stream operator.

@adamgfraser adamgfraser requested review from jdegoes and vigoo February 5, 2023 16:20
@vigoo
Copy link
Contributor

vigoo commented Feb 6, 2023

Feels a bit weird to me doing this if you have only a single ZPipeline.fromFunction applied to the stream (as if it would be a ZStream aspect it could directly transform the stream). But I guess it makes sense if you start composing it with other pipelines.

@adamgfraser
Copy link
Contributor Author

This couldn't be implemented as a stream aspect because it potentially changes the element type.

@vigoo
Copy link
Contributor

vigoo commented Feb 6, 2023

That's right. I just meant that it introduces extra channel components while in theory it could be just applied to the stream when it is "via'd" (or whatever it is called) to the stream. But that does not fit into our current model.

@adamgfraser
Copy link
Contributor Author

Yeah I think the main use case is if you want to represent a stream transformation as a pipeline so it is a first class value and you can compose it with other pipelines. It solves the problem of something being implemented as a stream operator and not a pipeline.

@jdegoes jdegoes merged commit 974c0bd into zio:series/2.x Feb 6, 2023
@adamgfraser adamgfraser deleted the zpipeline branch February 6, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants