
io.lettuce.core.dynamic.Batcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lettuce-core Show documentation
Show all versions of lettuce-core Show documentation
Advanced and thread-safe Java Redis client for synchronous, asynchronous, and
reactive usage. Supports Cluster, Sentinel, Pipelining, Auto-Reconnect, Codecs
and much more.
The newest version!
package io.lettuce.core.dynamic;
import io.lettuce.core.dynamic.batch.CommandBatching;
import io.lettuce.core.protocol.RedisCommand;
/**
* Command batcher to enqueue commands and flush a batch once a flush is requested or a configured command threshold is reached.
*
* @author Mark Paluch
* @since 5.0
* @see SimpleBatcher
*/
public interface Batcher {
/**
* Batcher that does not support batching.
*/
Batcher NONE = (command, batching) -> {
throw new UnsupportedOperationException();
};
/**
* Add command to the {@link Batcher}.
*
* @param command the command to batch.
* @param batching invocation-specific {@link CommandBatching} control. May be {@code null} to use default batching
* settings.
* @return result of the batching. Either an {@link BatchTasks#EMPTY empty} result or a result containing the batched
* commands.
*/
BatchTasks batch(RedisCommand
© 2015 - 2025 Weber Informatics LLC | Privacy Policy