object CachedResource
- Companion
- class
class Object
trait Matchable
class Any
Type members
Classlikes
Value members
Concrete methods
def runAndInvalidateOnError[F[_], R, A](cr: CachedResource[F, R])(f: R => F[A], shouldInvalidate: PartialFunction[Throwable, Boolean])(implicit F: Bracket[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 Params
- 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: Bracket[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