CachedResource

trait CachedResource[F[_], R] extends Runner[F, R]
Companion:
object
trait Runner[F, R]
class Object
trait Matchable
class Any

Value members

Abstract methods

def invalidate: F[Unit]

Invalidates any current instance of R, guaranteeing that ???

Invalidates any current instance of R, guaranteeing that ???

def invalidateIfNeeded(shouldInvalidate: R => Boolean): F[Unit]

Invalidate if shouldRefresh returns true, otherwise do nothing

Invalidate if shouldRefresh returns true, otherwise do nothing

def run[A](f: R => F[A]): F[A]

Run f with an instance of R, possibly allocating a new one, or possibly reusing an existing one. Guarantees that R will not be invalidated until f returns

Run f with an instance of R, possibly allocating a new one, or possibly reusing an existing one. Guarantees that R will not be invalidated until f returns