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

Skip to content

Conversation

@neko-kai
Copy link
Member

  • use bracketExit in ZManaged.exit/First

* use bracketExit in ZManaged.exit/First
@neko-kai neko-kai requested a review from iravid October 28, 2019 11:03
a <- ZIO.done(exitA)
} yield a
},
acquire = ZIO.bracketExit(self.reserve)(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, what's the motivation for the change? The differences are mainly correct usage of ZIOFn and error preservation (which shouldn't matter here because finalizer.set is a UIO)

Copy link
Member Author

@neko-kai neko-kai Oct 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iravid Less low-level code; also this is the only instance of uninterruptibleMask(restore(_).catch) aside of bracketExit in core and turns out it just duplicates it – making it just reuse bracketExit also safeguards it against any changes to finalizer behavior :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, makes sense!

@iravid iravid merged commit 9009242 into zio:master Oct 28, 2019
ghostdogpr pushed a commit to ghostdogpr/scalaz-zio that referenced this pull request Nov 5, 2019
* Add ZManaged.makeInterruptible
* use bracketExit in ZManaged.exit/First

* Fix ZManaged.makeInterruptible scaladoc
Twizty pushed a commit to Twizty/zio that referenced this pull request Nov 13, 2019
* Add ZManaged.makeInterruptible
* use bracketExit in ZManaged.exit/First

* Fix ZManaged.makeInterruptible scaladoc
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.

2 participants