ResourceSharedMemoized

cats.effect.resource_shared_memoized.ResourceSharedMemoized

Attributes

Source
ResourceSharedMemoized.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def memoize[F[_] : Concurrent, A](resource: Resource[F, A]): F[Resource[F, A]]

Takes a Resource and returns a Resource that will allocate the resource once, even if you use it multiple times.

Takes a Resource and returns a Resource that will allocate the resource once, even if you use it multiple times. It keeps track of how many users it has and releases the Resource when there are no more users.

Attributes

Source
ResourceSharedMemoized.scala
def memoizeWithDelayedRelease[F[_] : Temporal, A](resource: Resource[F, A], keepAfterRelease: FiniteDuration): F[Resource[F, A]]

Takes a Resource and returns a Resource that will allocate the resource once, even if you use it multiple times.

Takes a Resource and returns a Resource that will allocate the resource once, even if you use it multiple times. It keeps track of how many users it has and releases the Resource when there are no more users.

Keeps the resource around for keepAfterRelease when the last user stops using it before releasing.

Attributes

Source
ResourceSharedMemoized.scala