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

Skip to content

Conversation

@guizmaii
Copy link
Member

No description provided.

@guizmaii guizmaii self-assigned this Apr 15, 2025
@guizmaii guizmaii marked this pull request as draft April 15, 2025 14:34
@guizmaii guizmaii force-pushed the opt_ChannelExecutor_3 branch from 9decfd3 to f91f36c Compare April 15, 2025 14:35
input = leftExec

addFinalizer { exit =>
val effect = restorePipe(exit, previousInput)
Copy link
Member Author

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))
Copy link
Member Author

@guizmaii guizmaii Apr 15, 2025

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

Copy link
Collaborator

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.

Copy link
Member Author

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

@guizmaii guizmaii marked this pull request as ready for review April 15, 2025 22:12
@guizmaii guizmaii changed the title Optimise ChannelExecutor::restorePipe and its usages Clean ChannelExecutor::restorePipe and its usages Apr 15, 2025
input = prev

if (currInput ne null) currInput.close(exit) else ZIO.unit
if (currInput ne null) currInput.close(exit) else Exit.unit
Copy link
Contributor

@kyri-petrou kyri-petrou Apr 26, 2025

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[?]]

@guizmaii guizmaii merged commit 75df82b into series/2.x Apr 26, 2025
32 of 34 checks passed
@guizmaii guizmaii deleted the opt_ChannelExecutor_3 branch April 26, 2025 12:39
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