tuweni / org.apache.tuweni.kv / RedisKeyValueStore

RedisKeyValueStore

class RedisKeyValueStore : KeyValueStore (source)

A key-value store backed by Redis.

Parameters

uri - The uri to the Redis store.

Constructors

<init>

RedisKeyValueStore(port: Int = 6379, address: InetAddress = InetAddress.getLoopbackAddress())
RedisKeyValueStore(uri: String)

Open a Redis-backed key-value store.

Functions

close

fun close(): Unit

get

suspend fun get(key: Bytes): Bytes?

Retrieves data from the store.

put

suspend fun put(key: Bytes, value: Bytes): Unit

Puts data into the store.

Inherited Functions

getAsync

open fun getAsync(key: Bytes): AsyncResult<Bytes?>
open fun getAsync(dispatcher: CoroutineDispatcher, key: Bytes): AsyncResult<Bytes?>

Retrieves data from the store.

putAsync

open fun putAsync(key: Bytes, value: Bytes): AsyncCompletion
open fun putAsync(dispatcher: CoroutineDispatcher, key: Bytes, value: Bytes): AsyncCompletion

Puts data into the store.

Companion Object Functions

codec

fun codec(): <ERROR CLASS><Bytes, Bytes>

A RedisCodec for working with Bytes classes.

open

fun open(uri: String): RedisKeyValueStore
fun open(port: Int): RedisKeyValueStore
fun open(address: InetAddress): RedisKeyValueStore
fun open(port: Int, address: InetAddress): RedisKeyValueStore

Open a Redis-backed key-value store.