Async commands response order guarantees #2017
-
Hi, I'm using the async API to send a lot of commands at once. redisAsyncCommands
.evalsha(scriptSha, ScriptOutputType.MULTI, keys, values)
.whenCompleteAsync((result, throwable) -> {
responses.add(new RedisResponse(keys, values, result, throwable));
}); From the docs, I expect commands to be executed in the order they were sent. So, what I need to know is:
If somebody can shed some light on that, it would be great. Thx! UPDATE: I've now seen my error above (using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Good point. I assume you mean
See this page in the documentation for more details: https://github.com/lettuce-io/lettuce-core/wiki/Command-execution-reliability#message-ordering. But simply speaking, this should be fine as long as requests are coming from a single thread, as described by that page. |
Beta Was this translation helpful? Give feedback.
Good point. I assume you mean
whenCompleteAsync()
btw, which means that the code runs asynchronously => potentially in an unpredictable orderSee this page in the documentation for more details: https://github.com/lettuce-io/lettuce-core/wiki/Command-execution-reliability#message-ordering. But simply speaking, this should be fine as long as requests are coming from a single thread, as described by that page.