CachedResource

Companion:
class
class Object
trait Matchable
class Any

Type members

Classlikes

trait Runner[F[_], A]

Value members

Concrete methods

def runAndInvalidateOnError[F[_], R, A](cr: CachedResource[F, R])(f: R => F[A], shouldInvalidate: PartialFunction[Throwable, Boolean])(implicit F: MonadCancel[F, Throwable]): F[A]

Run f with get, and if f fails and shouldInvalidate returns true

Run f with get, and if f fails and shouldInvalidate returns true

Value parameters:
shouldInvalidate

If true, invalidate. If false or not defined, do not invalidate. Default: always invalidate (assuming NonFatal)

def runner[F[_], R, A](cr: CachedResource[F, R])(shouldRefresh: R => Boolean, shouldInvalidate: PartialFunction[Throwable, Boolean])(implicit F: MonadCancel[F, Throwable]): Runner[F, R]

Runner that checks if refresh is needed before each run call, and additionally can invalidate on errors

Runner that checks if refresh is needed before each run call, and additionally can invalidate on errors