class MapKeyValueStore : KeyValueStore
(source)
A key-value store backed by an in-memory Map.
map
- The backing map for this store.
Return
A key-value store.
MapKeyValueStore(map: MutableMap<Bytes, Bytes> = HashMap())
Open an in-memory key-value store. |
fun close(): Unit
Has no effect in this KeyValueStore implementation. |
|
suspend fun get(key: Bytes): Bytes?
Retrieves data from the store. |
|
suspend fun put(key: Bytes, value: Bytes): Unit
Puts data into the store. |
open fun getAsync(key: Bytes): AsyncResult<Bytes?> open fun getAsync(dispatcher: CoroutineDispatcher, key: Bytes): AsyncResult<Bytes?>
Retrieves data from the store. |
|
open fun putAsync(key: Bytes, value: Bytes): AsyncCompletion open fun putAsync(dispatcher: CoroutineDispatcher, key: Bytes, value: Bytes): AsyncCompletion
Puts data into the store. |
fun open(): MapKeyValueStore fun open(map: MutableMap<Bytes, Bytes>): MapKeyValueStore
Open an in-memory key-value store. |