cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

Implement a safer `Resource.attempt` which releases acquired resource(s) in case of error

Open lenguyenthanh opened this issue 1 year ago • 0 comments
trafficstars

This is my solution for #3757,

As I discussed with @armanbilge, the new method requires MonadCancelThrow in order to use Resource.allocatedCase which handles releasing acquired resource(s) in case of error. This pr also removed implicit ApplicativeError and deprecated the current attempt method.

~~This is a draft as it still needs to add tests and address some issues that I'll comment in the pr. But please give me early feedback.~~

lenguyenthanh avatar Sep 02 '24 18:09 lenguyenthanh