prepare

open fun prepare(key: String, value: V): Mono<Boolean>

Prepares a key with a value that never expires.

This method reserves the key permanently, ensuring no other operations can use the same key until it's explicitly rolled back.

Return

A Mono emitting true if preparation succeeded, false if key was already prepared

Parameters

key

The unique key to prepare

value

The value to associate with the key

See also

(String, PreparedValue) for TTL-based preparation


abstract fun prepare(key: String, value: PreparedValue<V>): Mono<Boolean>

Prepares a key with a value that may have a time-to-live.

This method reserves the key for a specified duration, after which it automatically expires if not used. This is useful for temporary reservations or cleanup scenarios.

Return

A Mono emitting true if preparation succeeded, false if key was already prepared

Parameters

key

The unique key to prepare

value

The prepared value with optional TTL

See also

for TTL configuration

Throws

if key is null or empty