Registry

abstract
class Registry[F[_], A, B]

A thread-safe Map-like storage with advanced operations like getOrInsert and use that support long-running computations

Companion
object
class Object
trait Matchable
class Any
class Store[F, A, B]

Value members

Abstract methods

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

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.

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

def remove(key: A): F[Option[B]]

Remove element by key

Remove element by key

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