@Test public void shouldNotReadUnCommittedMessages() { ChannelConsumer consumer = newConsumer(); assertTrue(producer.claim()); Example writer = producer.currentElement(); writer.setBar(10L); assertFalse(consumer.read()); }
@SuppressWarnings("unchecked") private SpscChannelConsumer<E> newConsumer(Object... args) { return mapper.newFlyweight(SpscChannelConsumer.class, "ChannelConsumerTemplate.java", Template.fromFile(Channel.class, "ChannelConsumerTemplate.java"), args); }
SpscChannel implements Channel<E> { @SuppressWarnings("unchecked") private SpscChannelConsumer<E> newConsumer(Object... args) { return mapper.newFlyweight(SpscChannelConsumer.class, "ChannelConsumerTemplate.java", Template.fromFile(Channel.class, "ChannelConsumerTemplate.java"), args); } }
SpscChannel implements Channel<E> { @SuppressWarnings("unchecked") private SpscChannelConsumer<E> newConsumer(Object... args) { return mapper.newFlyweight(SpscChannelConsumer.class, "ChannelConsumerTemplate.java", Template.fromFile(Channel.class, "ChannelConsumerTemplate.java"), args); } SpscChannel(final ByteBuffer buffer, final int requestedCapacity, final Class<E> type); }
SpscChannel implements Channel<E> { @SuppressWarnings("unchecked") private SpscChannelConsumer<E> newConsumer(Object... args) { return mapper.newFlyweight(SpscChannelConsumer.class, "ChannelConsumerTemplate.java", Template.fromFile(Channel.class, "ChannelConsumerTemplate.java"), args); } SpscChannel(final ByteBuffer buffer, final int requestedCapacity, final Class<E> type); ChannelConsumer consumer(ChannelReceiver<E> receiver); ChannelProducer<E> producer(); int size(); int maximumCapacity(); @Override int requestedCapacity(); boolean isEmpty(); }
SpscChannel implements Channel<E> { @SuppressWarnings("unchecked") private SpscChannelConsumer<E> newConsumer(Object... args) { return mapper.newFlyweight(SpscChannelConsumer.class, "ChannelConsumerTemplate.java", Template.fromFile(Channel.class, "ChannelConsumerTemplate.java"), args); } SpscChannel(final ByteBuffer buffer, final int requestedCapacity, final Class<E> type); ChannelConsumer consumer(ChannelReceiver<E> receiver); ChannelProducer<E> producer(); int size(); int maximumCapacity(); @Override int requestedCapacity(); boolean isEmpty();  }