Commands and coroutines
Latest stable Based on Bluetape4k release 1.11.0
Keep one execution model per path
Section titled “Keep one execution model per path”commands is blocking, asyncCommands returns RedisFuture, and coroutinesCommands exposes Lettuce’s experimental coroutine API. Sync calls can fit a blocking service boundary; coroutine services should remain async or suspending end to end.
val async = LettuceClients.asyncCommands(client)val value = async.get("account:1").awaitSuspending()val values = listOf(async.get("a"), async.get("b")).awaitAll()awaitAll() preserves input order, returns an empty list for empty input, and propagates a failed future instead of constructing partial results.
Cancellation is not a cache miss
Section titled “Cancellation is not a cache miss”awaitSuspending() follows kotlinx.coroutines.future.await cancellation rules. Suspended loaded maps also rethrow CancellationException. Converting cancellation into a Redis miss would invoke a database loader after the caller has already abandoned the work.
Command capability checks
Section titled “Command capability checks”RedisCommandSupports caches COMMAND INFO per client and command and closes its temporary connection. An inspection failure returns false, so permissions and true server incompatibility may need separate operational diagnosis.
Source and tests
Section titled “Source and tests”Continue with Codecs and serialization.