class GuavaDataStore<T : Any>


The class that wraps around DataStore to provide an interface that returns ListenableFutures for DataStore reads and writes.

Summary

Nested types

Builder class for a GuavaDataStore that works on a single process.

Public functions

ListenableFuture<T>

Returns a ListenableFuture to get the latest persisted data.

ListenableFuture<T>
updateDataAsync(transform: (input) -> T)

Returns a ListenableFuture to update the data using the provided transform.

Public functions

getDataAsync

Added in 1.2.0-alpha01
fun getDataAsync(): ListenableFuture<T>

Returns a ListenableFuture to get the latest persisted data. It is not blocked by any ongoing updates.

updateDataAsync

Added in 1.2.0-alpha01
fun updateDataAsync(transform: (input) -> T): ListenableFuture<T>

Returns a ListenableFuture to update the data using the provided transform. The transform is given the latest persisted data to produce its output, which is then persisted and returned. Concurrent updates are serialized (at most one update running at a time).