usingPrepare
Executes an operation within a prepare context with permanent value.
This method provides transaction-like semantics: it prepares a key, executes the provided operation, and automatically rolls back the preparation if the operation fails.
Return
A Mono with the operation result, with automatic rollback on failure
Parameters
The return type of the operation
The key to prepare for the operation
The permanent value to prepare
A function that receives the preparation result and returns a Mono with the operation
See also
(String, PreparedValue, (Boolean) -> Mono) for TTL support
Executes an operation within a prepare context with optional TTL.
This method provides transaction-like semantics for key preparation. If the key preparation succeeds and the subsequent operation fails, the preparation is automatically rolled back. This ensures consistency and prevents resource leaks.
Return
A Mono with the operation result, with automatic rollback on failure
Parameters
The return type of the operation
The key to prepare for the operation
The prepared value with optional TTL
A function that receives the preparation result (true/false) and returns a Mono with the operation to execute
Throws
if the operation fails after successful preparation (rollback attempted)