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

Preserve Scope In Stream#tapErrorCause #8248

Merged
merged 1 commit into from Jul 14, 2023
Merged

Conversation

adamgfraser
Copy link
Contributor

Resolves #8244.

ZChannel.flatMap and ZChannel.fold run finalizers associated with the left hand side channel before executing the right hand side channel, as the left hand side channel is conceptually "done" at that point. In contrast ZChannel.concatMap defers running finalizers associated with the outer channel until the inner channels complete execution.

Currently ZStream.tapError and Stream.tapErrorCause can prematurely close the scope, because they are implemented in terms of ZChannel.fold. This PR changes this by implementing these operators in terms of ZChannel.pipeTo.

@adamgfraser adamgfraser requested review from jdegoes and vigoo and removed request for jdegoes July 5, 2023 19:23
@jdegoes jdegoes merged commit e3f2196 into zio:series/2.x Jul 14, 2023
22 checks passed
@adamgfraser adamgfraser deleted the 8244 branch July 14, 2023 14:30
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.

Strange ZStream peel scope handling
2 participants