InMemoryStore

final class InMemoryStore[F[_], A, B](lock: Semaphore[F], registry: InMemoryRegistry[F, A, B])(implicit F: Sync[F]) extends Store[F, A, B]
Companion:
object
class Store[F, A, B]
class Registry[F, A, B]
class Object
trait Matchable
class Any

Value members

Concrete methods

override def get(key: A): F[Option[B]]

Get the value for the given key, potentially blocking when a getOrInsert fallback is currently being evaluated for this key

Get the value for the given key, potentially blocking when a getOrInsert fallback is currently being evaluated for this key

Definition Classes
Registry
override def getOrInsert(key: A, fallback: => F[B]): F[B]

Get the value for the given key, potentially blocking when a getOrInsert fallback is currently being evaluated for this key

Get the value for the given key, potentially blocking when a getOrInsert fallback is currently being evaluated for this key

fallback will only be evaluated for insertion if no value exists for this key.

Definition Classes
Registry
override def insert(key: A, value: B): F[Option[B]]

Insert an element into the Register, potentially overriding an existing value with the given key

Insert an element into the Register, potentially overriding an existing value with the given key

Returns:

Element that was previously assigned to that key

Definition Classes
Registry
override def remove(key: A): F[Option[B]]

Remove element by key

Remove element by key

Definition Classes
Registry
override def tryGet(key: A): F[Option[B]]

Get the value for the given key, not waiting for a currently active fallback execution

Get the value for the given key, not waiting for a currently active fallback execution

Definition Classes
Registry

Concrete fields

override val available: F[Int]

Amount of elements stored in the Store, not including currently evaluating fallbacks

Amount of elements stored in the Store, not including currently evaluating fallbacks

override val clear: F[Map[A, B]]

Remove all elements

Remove all elements

override val size: F[Int]

Amount of elements stored in the Store including currently evaluating fallbacks

Amount of elements stored in the Store including currently evaluating fallbacks