Attributes
- Companion:
- class
- Source:
- Resource.scala
- Graph
- Supertypes
- trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
- Resource.type
Members list
Type members
Classlikes
Resource
data constructor that wraps an effect allocating a resource, along with its
finalizers.
Resource
data constructor that wraps an effect allocating a resource, along with its
finalizers.
Attributes
- Source:
- Resource.scala
- Graph
- Supertypes
Resource
data constructor that encodes the flatMap
operation.
Resource
data constructor that encodes the flatMap
operation.
Attributes
- Source:
- Resource.scala
- Graph
- Supertypes
Attributes
- Source:
- Resource.scala
- Graph
- Supertypes
Attributes
- Companion:
- trait
- Source:
- Resource.scala
- Graph
- Supertypes
- trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
- ExitCase.type
Type for signaling the exit condition of an effectful computation, that may either succeed, fail with an error or get canceled.
Type for signaling the exit condition of an effectful computation, that may either succeed, fail with an error or get canceled.
The types of exit signals are:
Attributes
- Companion:
- object
- Source:
- Resource.scala
- Graph
- Supertypes
- Known subtypes
Attributes
- Source:
- Resource.scala
- Graph
- Supertypes
- class AnyValtrait Matchableclass Any
Types
Attributes
- Source:
- Resource.scala
Inherited types
The names of the product elements
The name of the type
Value members
Concrete methods
Creates a resource from an allocating effect.
Creates a resource from an allocating effect.
Attributes
- A
the type of the resource
- F
the effect type in which the resource is acquired and released
- resource
an effect that returns a tuple of a resource and an effect to release it
- See also:
make for a version that separates the needed resource with its finalizer tuple in two parameters
- Source:
- Resource.scala
Creates a resource from an allocating effect, with a finalizer that is able to distinguish between exit cases.
Creates a resource from an allocating effect, with a finalizer that is able to distinguish between exit cases.
Attributes
- A
the type of the resource
- F
the effect type in which the resource is acquired and released
- resource
an effect that returns a tuple of a resource and an effectful function to release it
- See also:
makeCase for a version that separates the needed resource with its finalizer tuple in two parameters
- Source:
- Resource.scala
Creates a resource from an allocating effect, with a finalizer that is able to distinguish between exit cases.
Creates a resource from an allocating effect, with a finalizer that is able to distinguish between exit cases.
The action takes a Poll[F]
to allow for interruptible acquires, which is most often
useful when acquiring lock-like structure: it should be possible to interrupt a 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)
TODO make sure this api, which is more general than makeFull, doesn't allow for interruptible releases
Attributes
- A
the type of the resource
- F
the effect type in which the resource is acquired and released
- resource
an effect that returns a tuple of a resource and an effectful function to release it, where acquisition can potentially be interrupted
- See also:
makeFull for a version that separates the needed resource with its finalizer tuple in two parameters
- Source:
- Resource.scala
Allocates two resources concurrently, and combines their results in a tuple.
Allocates two resources concurrently, and combines their results in a tuple.
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Lifts an applicative into a resource. The resource has a no-op release. Preserves
interruptibility of fa
.
Lifts an applicative into a resource. The resource has a no-op release. Preserves
interruptibility of fa
.
Attributes
- fa
the value to lift into a resource
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Creates a Resource by wrapping a Java AutoCloseable.
Creates a Resource by wrapping a Java AutoCloseable.
In most real world cases, implementors of AutoCloseable are blocking as well, so the close action runs in the blocking context.
Attributes
- A
the type of the autocloseable resource
- F
the type of the effect
- F
the effect type in which the resource was acquired and will be released
- acquire
The effect with the resource to acquire.
- Returns:
a Resource that will automatically close after use
- Example:
import cats.effect._ import scala.io.Source def reader(data: String): Resource[IO, Source] = Resource.fromAutoCloseable(IO.blocking { Source.fromString(data) })
import cats.effect._ import scala.io.Source def reader[F[_]](data: String)(implicit F: Sync[F]): Resource[F, Source] = Resource.fromAutoCloseable(F.blocking { Source.fromString(data) })
- Source:
- Resource.scala
Lifts an applicative into a resource as a FunctionK
. The resource has a no-op release.
Lifts an applicative into a resource as a FunctionK
. The resource has a no-op release.
Attributes
- Source:
- Resource.scala
Creates a resource from an acquiring effect and a release function.
Creates a resource from an acquiring effect and a release function.
Attributes
- A
the type of the resource
- F
the effect type in which the resource is acquired and released
- acquire
an effect to acquire a resource
- release
a function to effectfully release the resource returned by
acquire
- Source:
- Resource.scala
Creates a resource from an acquiring effect and a release function that can discriminate between different exit cases.
Creates a resource from an acquiring effect and a release function that can discriminate between different exit cases.
Attributes
- A
the type of the resource
- F
the effect type in which the resource is acquired and released
- acquire
a function to effectfully acquire a resource
- release
a function to effectfully release the resource returned by
acquire
- Source:
- Resource.scala
Creates a resource from an acquiring effect and a release function that can discriminate between different exit cases.
Creates a resource from an acquiring effect and a release function that can discriminate between different exit cases.
The acquiring effect takes a Poll[F]
to allow for interruptible acquires, which is most
often useful when acquiring lock-like structures: it should be possible to interrupt a
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)
Attributes
- A
the type of the resource
- F
the effect type in which the resource is acquired and released
- acquire
an effect to acquire a resource, possibly interruptibly
- release
a function to effectfully release the resource returned by
acquire
- Source:
- Resource.scala
Creates a resource from an acquiring effect and a release function that can discriminate between different exit cases.
Creates a resource from an acquiring effect and a release function that can discriminate between different exit cases.
The acquiring effect takes a Poll[F]
to allow for interruptible acquires, which is most
often useful when acquiring lock-like structures: it should be possible to interrupt a
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)
Attributes
- A
the type of the resource
- F
the effect type in which the resource is acquired and released
- acquire
an effect to acquire a resource, possibly interruptibly
- release
a function to effectfully release the resource returned by
acquire
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Lifts a finalizer into a resource. The resource has a no-op allocation.
Lifts a finalizer into a resource. The resource has a no-op allocation.
Attributes
- Source:
- Resource.scala
Creates a resource that allocates immediately without any effects, but calls release
when
closing, providing the the usage completed with.
Creates a resource that allocates immediately without any effects, but calls release
when
closing, providing the the usage completed with.
Attributes
- Source:
- Resource.scala
Lifts a pure value into a resource. The resource has a no-op release.
Lifts a pure value into a resource. The resource has a no-op release.
Attributes
- a
the value to lift into a resource
- Source:
- Resource.scala
Races the evaluation of two resource allocations and returns the result of the winner, except in the case of cancelation.
Races the evaluation of two resource allocations and returns the result of the winner, except in the case of cancelation.
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Given a Resource
suspended in F[_]
, lifts it in the Resource
context.
Given a Resource
suspended in F[_]
, lifts it in the Resource
context.
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
A resource with a no-op allocation and a no-op release.
Deprecated methods
Attributes
- Deprecated
- true
- Source:
- Resource.scala
Deprecated and Inherited methods
Attributes
- Deprecated
- true
- Inherited from:
- ResourceHOInstances5 (hidden)
- Source:
- Resource.scala
Attributes
- Deprecated
- true
- Inherited from:
- ResourceFOInstances0 (hidden)
- Source:
- Resource.scala
Attributes
- Deprecated
- true
- Inherited from:
- ResourceFOInstances1 (hidden)
- Source:
- Resource.scala
Implicits
Implicits
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Attributes
- Source:
- Resource.scala
Inherited implicits
Attributes
- Inherited from:
- ResourceHOInstances0 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances2 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances2 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances2 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances3 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances4 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances5 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceFOInstances0 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceFOInstances1 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances0 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances1 (hidden)
- Source:
- Resource.scala
Attributes
- Inherited from:
- ResourceHOInstances1 (hidden)
- Source:
- Resource.scala