ch.j3t.prefetcher

Type members

Classlikes

Concrete implementation for the PrefetchingSupplier trait. Should be used most of the time.

Concrete implementation for the PrefetchingSupplier trait. Should be used most of the time.

Type parameters:
T

the type of the pre-fetched value

Value parameters:
prefetchedValueRef

the Ref pointing to the currently held pre-fetched value

updateFiber

the fiber running the regular update job

implicit class MapLookupHelper[K, V](m: Map[K, V])

Implicit class for looking up elements in a pre-fetched map.

Implicit class for looking up elements in a pre-fetched map.

Allows returning a failed ZIO if the element cannot be found.

Type parameters:
K

key type

V

value type

Value parameters:
m

the map on which to do the lookup

final case class NotFound(message: String, cause: Option[NotFound]) extends Exception

Conveys the fact that a lookup failed.

Conveys the fact that a lookup failed.

Value parameters:
cause

when failing to look up a set of keys, contains the error for the first key that was not found.

message

details about the failed lookup

implicit class PrefetcherLookupHelper[K, N, V](a: PrefetchingSupplier[Map[K, Map[N, V]]])

Implicit class for easing lookups in prefetchers that contain nested maps.

Implicit class for easing lookups in prefetchers that contain nested maps.

Type parameters:
K

outer key type

N

nested key type

V

value type

Value parameters:
a

the instance to do the lookup on

This class is akin to a Supplier[T] that will always have a T immediately available, while it is updated by a background job on a regular basis.

This class is akin to a Supplier[T] that will always have a T immediately available, while it is updated by a background job on a regular basis.

Type parameters:
T

the type of the pre-fetched value

Companion:
object
Companion:
class

Static implementation of the prefetching supplier trait.

Static implementation of the prefetching supplier trait.

Mostly useful for tests.

Type parameters:
T

the type of the pre-fetched value

Value parameters:
get

the forever fixed value to be returned

Implicits

Implicits

final implicit def MapLookupHelper[K, V](m: Map[K, V]): MapLookupHelper[K, V]

Implicit class for looking up elements in a pre-fetched map.

Implicit class for looking up elements in a pre-fetched map.

Allows returning a failed ZIO if the element cannot be found.

Type parameters:
K

key type

V

value type

Value parameters:
m

the map on which to do the lookup

final implicit def PrefetcherLookupHelper[K, N, V](a: PrefetchingSupplier[Map[K, Map[N, V]]]): PrefetcherLookupHelper[K, N, V]

Implicit class for easing lookups in prefetchers that contain nested maps.

Implicit class for easing lookups in prefetchers that contain nested maps.

Type parameters:
K

outer key type

N

nested key type

V

value type

Value parameters:
a

the instance to do the lookup on