/** * Writes the given part of the message to the buffer. This can fail if the publisher limit or the * buffer partition size is reached. * * @return the new publisher position if the message was written successfully. Otherwise, the * return value is negative. */ public long offer(DirectBuffer msg, int start, int length) { return offer(msg, start, length, 0); }
protected int onMessage(DirectBuffer buffer, int offset, int length, int streamId) { if (receiveBuffer == null) { return CONSUME_FRAGMENT_RESULT; } final long offerPosition = receiveBuffer.offer(buffer, offset, length, streamId); if (offerPosition < 0) { return POSTPONE_FRAGMENT_RESULT; } else { return CONSUME_FRAGMENT_RESULT; } }
/** * Writes the given part of the message to the buffer. This can fail if the publisher limit or the * buffer partition size is reached. * * @return the new publisher position if the message was written successfully. Otherwise, the * return value is negative. */ public long offer(DirectBuffer msg, int start, int length) { return offer(msg, start, length, 0); }
protected int onMessage(DirectBuffer buffer, int offset, int length, int streamId) { if (receiveBuffer == null) { return CONSUME_FRAGMENT_RESULT; } final long offerPosition = receiveBuffer.offer(buffer, offset, length, streamId); if (offerPosition < 0) { return POSTPONE_FRAGMENT_RESULT; } else { return CONSUME_FRAGMENT_RESULT; } }
/** * Writes the given message to the buffer with the given stream id. This can fail if the publisher * limit or the buffer partition size is reached. * * @return the new publisher position if the message was written successfully. Otherwise, the * return value is negative. */ public long offer(DirectBuffer msg, int streamId) { return offer(msg, 0, msg.capacity(), streamId); }
/** * Writes the given message to the buffer. This can fail if the publisher limit or the buffer * partition size is reached. * * @return the new publisher position if the message was written successfully. Otherwise, the * return value is negative. */ public long offer(DirectBuffer msg) { return offer(msg, 0, msg.capacity(), 0); }
/** * Writes the given message to the buffer. This can fail if the publisher limit or the buffer * partition size is reached. * * @return the new publisher position if the message was written successfully. Otherwise, the * return value is negative. */ public long offer(DirectBuffer msg) { return offer(msg, 0, msg.capacity(), 0); }
/** * Writes the given message to the buffer with the given stream id. This can fail if the publisher * limit or the buffer partition size is reached. * * @return the new publisher position if the message was written successfully. Otherwise, the * return value is negative. */ public long offer(DirectBuffer msg, int streamId) { return offer(msg, 0, msg.capacity(), streamId); }
@Override public int onFragment( DirectBuffer buffer, int offset, int length, int streamId, boolean isMarkedFailed) { if (receiveBuffer == null) { return CONSUME_FRAGMENT_RESULT; } if (!isMarkedFailed) { transportHeaderDescriptor.wrap(buffer, offset); if (transportHeaderDescriptor.protocolId() == TransportHeaderDescriptor.CONTROL_MESSAGE) { // don't forward control messages return CONSUME_FRAGMENT_RESULT; } final long offerPosition = receiveBuffer.offer(buffer, offset, length, streamId); if (offerPosition < 0) { return POSTPONE_FRAGMENT_RESULT; } else { return CONSUME_FRAGMENT_RESULT; } } else { return CONSUME_FRAGMENT_RESULT; } } }
@Override public int onFragment( DirectBuffer buffer, int offset, int length, int streamId, boolean isMarkedFailed) { if (receiveBuffer == null) { return CONSUME_FRAGMENT_RESULT; } if (!isMarkedFailed) { transportHeaderDescriptor.wrap(buffer, offset); if (transportHeaderDescriptor.protocolId() == TransportHeaderDescriptor.CONTROL_MESSAGE) { // don't forward control messages return CONSUME_FRAGMENT_RESULT; } final long offerPosition = receiveBuffer.offer(buffer, offset, length, streamId); if (offerPosition < 0) { return POSTPONE_FRAGMENT_RESULT; } else { return CONSUME_FRAGMENT_RESULT; } } else { return CONSUME_FRAGMENT_RESULT; } } }