Adds a withBorrowedClient method on both Application.Redis and Request.Redis for being able to lease a RedisClient for a specified amount of time to execute commands serially with.
This allows for a custom execution of MULTI commands in the following way
request.redis.withBorrowedClient {
return client
.send(command: "MULTI")
.flatMap { _ in client.send(command: "PING") }
.flatMap { _ in client.send(command: "EXEC") }
}
// this is now an 'EventLoopFuture<RESPValue>' with the value being an array of RESPValue result of every queued command
Adds a
withBorrowedClient
method on bothApplication.Redis
andRequest.Redis
for being able to lease aRedisClient
for a specified amount of time to execute commands serially with.This allows for a custom execution of
MULTI
commands in the following wayThis fixes #190