@Test void receiveIsANoOpIfNothingWasWritten() { messageTransceiver.receive(); verifyNoInteractions(messageRecorder); }
public void receive() { final long checksumOffset = offset(receiveIndex + 1); final long[] messages = this.messages; final long checksum = UNSAFE.getLongVolatile(messages, checksumOffset); if (0L != checksum) { final long timestampOffset = offset(receiveIndex); final long timestamp = UNSAFE.getLong(messages, timestampOffset); UNSAFE.putLong(messages, timestampOffset, 0L); UNSAFE.putOrderedLong(messages, checksumOffset, 0L); onMessageReceived(timestamp, checksum); receiveIndex += 1 + PADDING; } }
InMemoryMessageTransceiver extends InMemoryMessageTransceiver2 { public void receive() { final long checksumOffset = offset(receiveIndex + 1); final long[] messages = this.messages; final long checksum = UNSAFE.getLongVolatile(messages, checksumOffset); if (0L != checksum) { final long timestampOffset = offset(receiveIndex); final long timestamp = UNSAFE.getLong(messages, timestampOffset); UNSAFE.putLong(messages, timestampOffset, 0L); UNSAFE.putOrderedLong(messages, checksumOffset, 0L); onMessageReceived(timestamp, checksum); receiveIndex += 1 + PADDING; } } }
InMemoryMessageTransceiver extends InMemoryMessageTransceiver2 { public void receive() { final long checksumOffset = offset(receiveIndex + 1); final long[] messages = this.messages; final long checksum = UNSAFE.getLongVolatile(messages, checksumOffset); if (0L != checksum) { final long timestampOffset = offset(receiveIndex); final long timestamp = UNSAFE.getLong(messages, timestampOffset); UNSAFE.putLong(messages, timestampOffset, 0L); UNSAFE.putOrderedLong(messages, checksumOffset, 0L); onMessageReceived(timestamp, checksum); receiveIndex += 1 + PADDING; } } InMemoryMessageTransceiver(final MessageRecorder messageRecorder); }
InMemoryMessageTransceiver extends InMemoryMessageTransceiver2 { public void receive() { final long checksumOffset = offset(receiveIndex + 1); final long[] messages = this.messages; final long checksum = UNSAFE.getLongVolatile(messages, checksumOffset); if (0L != checksum) { final long timestampOffset = offset(receiveIndex); final long timestamp = UNSAFE.getLong(messages, timestampOffset); UNSAFE.putLong(messages, timestampOffset, 0L); UNSAFE.putOrderedLong(messages, checksumOffset, 0L); onMessageReceived(timestamp, checksum); receiveIndex += 1 + PADDING; } } InMemoryMessageTransceiver(final MessageRecorder messageRecorder); void init(final Configuration configuration); void destroy(); int send(final int numberOfMessages, final int messageLength, final long timestamp, final long checksum); void receive(); }
InMemoryMessageTransceiver extends InMemoryMessageTransceiver2 { public void receive() { final long checksumOffset = offset(receiveIndex + 1); final long[] messages = this.messages; final long checksum = UNSAFE.getLongVolatile(messages, checksumOffset); if (0L != checksum) { final long timestampOffset = offset(receiveIndex); final long timestamp = UNSAFE.getLong(messages, timestampOffset); UNSAFE.putLong(messages, timestampOffset, 0L); UNSAFE.putOrderedLong(messages, checksumOffset, 0L); onMessageReceived(timestamp, checksum); receiveIndex += 1 + PADDING; } } InMemoryMessageTransceiver(final MessageRecorder messageRecorder); void init(final Configuration configuration); void destroy(); int send(final int numberOfMessages, final int messageLength, final long timestamp, final long checksum); void receive();  }