-
Couldn't load subscription status.
- Fork 1.4k
Clean ChannelExecutor::restorePipe and its usages
#9797
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
9decfd3 to
f91f36c
Compare
| input = leftExec | ||
|
|
||
| addFinalizer { exit => | ||
| val effect = restorePipe(exit, previousInput) |
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.
effect can never be null
| if (effect ne null) effect | ||
| else ZIO.unit | ||
| } | ||
| ZIO.suspendSucceed(restorePipe(exit, inputExecutor)) |
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.
Not convinced the ZIO.suspendSucceed is needed 🤔
Kept it as a conservative move
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.
It's not necessary since this will be in a flatMap.
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.
Took a second look and there was more useless stuff. See 8399ae6
ChannelExecutor::restorePipe and its usagesChannelExecutor::restorePipe and its usages
| input = prev | ||
|
|
||
| if (currInput ne null) currInput.close(exit) else ZIO.unit | ||
| if (currInput ne null) currInput.close(exit) else Exit.unit |
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.
Minor suggestion, but maybe we should change addFinalizer so that it doesn't push the finalizer in the stack in case that it's eq Exit.unit (or even .isInstanceOf[Exit.Success[?]]
No description provided.