Skip to content

Commit

Permalink
Merge pull request #3390 from davidabrahams/series/3.x
Browse files Browse the repository at this point in the history
Update Resource.scala comments to clarify that release is only run when acquire succeeds
  • Loading branch information
SystemFw authored Jan 29, 2023
2 parents 20deae5 + 64688d1 commit 7507b31
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kernel/shared/src/main/scala/cats/effect/kernel/Resource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ object Resource extends ResourceFOInstances0 with ResourceHOInstances0 with Reso
* waiting on a lock, but if it does get acquired, release need to be guaranteed.
*
* Note that in this case the acquire action should know how to cleanup after itself in case
* it gets canceled, since Resource will only guarantee release when acquire succeeds and
* fails (and when the actions in `use` or `flatMap` fail, succeed, or get canceled)
* it gets canceled, since Resource will only guarantee release when acquire succeeds (and
* when the actions in `use` or `flatMap` fail, succeed, or get canceled)
*
* TODO make sure this api, which is more general than makeFull, doesn't allow for
* interruptible releases
Expand Down Expand Up @@ -874,8 +874,8 @@ object Resource extends ResourceFOInstances0 with ResourceHOInstances0 with Reso
* fiber waiting on a lock, but if it does get acquired, release need to be guaranteed.
*
* Note that in this case the acquire action should know how to cleanup after itself in case
* it gets canceled, since Resource will only guarantee release when acquire succeeds and
* fails (and when the actions in `use` or `flatMap` fail, succeed, or get canceled)
* it gets canceled, since Resource will only guarantee release when acquire succeeds (and
* when the actions in `use` or `flatMap` fail, succeed, or get canceled)
*
* @tparam F
* the effect type in which the resource is acquired and released
Expand All @@ -899,8 +899,8 @@ object Resource extends ResourceFOInstances0 with ResourceHOInstances0 with Reso
* fiber waiting on a lock, but if it does get acquired, release need to be guaranteed.
*
* Note that in this case the acquire action should know how to cleanup after itself in case
* it gets canceled, since Resource will only guarantee release when acquire succeeds and
* fails (and when the actions in `use` or `flatMap` fail, succeed, or get canceled)
* it gets canceled, since Resource will only guarantee release when acquire succeeds (and
* when the actions in `use` or `flatMap` fail, succeed, or get canceled)
*
* @tparam F
* the effect type in which the resource is acquired and released
Expand Down

0 comments on commit 7507b31

Please sign in to comment.