AtomicAsyncDsl

final class AtomicAsyncDsl[K, V](db: Database, store: Async[K, V])
class Object
trait Matchable
class Any

Value members

Concrete methods

def modify(key: K)(f: V => V): AsyncCallback[Option[(V, V)]]

Performs an async modification on a store value.

Performs an async modification on a store value.

This only modifies an existing value. Use modifyAsyncOption() to upsert and/or delete values.

This uses compareAndSet() for atomicity and thread-safety.

Returns:

If the value exists, this returns the previous and updated values

def modifyAsync(key: K)(f: V => AsyncCallback[V]): AsyncCallback[Option[(V, V)]]

Performs an async modification on a store value.

Performs an async modification on a store value.

This only modifies an existing value. Use modifyAsyncOption() to upsert and/or delete values.

This uses compareAndSet() for atomicity and thread-safety.

Returns:

If the value exists, this returns the previous and updated values

def modifyOption(key: K)(f: Option[V] => Option[V]): AsyncCallback[(Option[V], Option[V])]

Performs an async modification on an optional store value.

Performs an async modification on an optional store value.

This uses compareAndSet() for atomicity and thread-safety.

Returns:

The previous and updated values

def modifyOptionAsync(key: K)(f: Option[V] => AsyncCallback[Option[V]]): AsyncCallback[(Option[V], Option[V])]

Performs an async modification on an optional store value.

Performs an async modification on an optional store value.

This uses compareAndSet() for atomicity and thread-safety.

Returns:

The previous and updated values