
io.lettuce.core.output.ValueStreamingOutput 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.output;
import java.nio.ByteBuffer;
import io.lettuce.core.codec.RedisCodec;
/**
* Streaming-Output of Values. Returns the count of all values (including null).
*
* @param Key type.
* @param Value type.
* @author Mark Paluch
*/
public class ValueStreamingOutput extends CommandOutput {
private final ValueStreamingChannel channel;
public ValueStreamingOutput(RedisCodec codec, ValueStreamingChannel channel) {
super(codec, Long.valueOf(0));
this.channel = channel;
}
@Override
public void set(ByteBuffer bytes) {
channel.onValue(bytes == null ? null : codec.decodeValue(bytes));
output = output.longValue() + 1;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy