use of com.hazelcast.client.impl.protocol.codec.RingbufferAddCodec in project hazelcast by hazelcast.
the class ClientRingbufferProxy method addAsync.
@Override
public InternalCompletableFuture<Long> addAsync(@Nonnull E item, @Nonnull OverflowPolicy overflowPolicy) {
checkNotNull(item, "item can't be null");
checkNotNull(overflowPolicy, "overflowPolicy can't be null");
Data element = toData(item);
ClientMessage request = RingbufferAddCodec.encodeRequest(name, overflowPolicy.getId(), element);
try {
ClientInvocationFuture future = new ClientInvocation(getClient(), request, getName(), partitionId).invoke();
return new ClientDelegatingFuture<>(future, getSerializationService(), RingbufferAddCodec::decodeResponse);
} catch (Exception e) {
throw rethrow(e);
}
}
Aggregations