Search in sources :

Example 1 with RedisFuture

use of com.generallycloud.baseio.codec.redis.future.RedisFuture in project baseio by generallycloud.

the class RedisProtocolEncoder method encode.

@Override
public void encode(SocketChannel channel, ChannelFuture future) throws IOException {
    RedisFuture f = (RedisFuture) future;
    int writeSize = f.getWriteSize();
    if (writeSize == 0) {
        throw new IOException("null write buffer");
    }
    ByteBuf buf = UnpooledByteBufAllocator.getHeap().wrap(f.getWriteBuffer(), 0, writeSize);
    future.setByteBuf(buf);
}
Also used : RedisFuture(com.generallycloud.baseio.codec.redis.future.RedisFuture) IOException(java.io.IOException) ByteBuf(com.generallycloud.baseio.buffer.ByteBuf)

Aggregations

ByteBuf (com.generallycloud.baseio.buffer.ByteBuf)1 RedisFuture (com.generallycloud.baseio.codec.redis.future.RedisFuture)1 IOException (java.io.IOException)1