@Test public void shouldNotOverrunBuffer() { for (int i = 0; i < REQUESTED_CAPACITY; i++) { assertTrue(producer.claim()); assertTrue(producer.commit()); } for (int i = REQUESTED_CAPACITY; i < MAXIMUM_CAPACITY; i++) { producer.claim(); producer.commit(); } assertFalse(producer.claim()); assertTrue(channel.size() >= REQUESTED_CAPACITY); assertTrue(channel.size() <= MAXIMUM_CAPACITY); }
public int size() { return producer.size(); }
SpscChannel implements Channel<E> { public int size() { return producer.size(); } }
SpscChannel implements Channel<E> { public int size() { return producer.size(); } SpscChannel(final ByteBuffer buffer, final int requestedCapacity, final Class<E> type); }
SpscChannel implements Channel<E> { public int size() { return producer.size(); } 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> { public int size() { return producer.size(); } 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();  }