Package org.jctools.channels.spsc
Class SpscChannelProducer<E>
- java.lang.Object
-
- org.jctools.channels.proxy.ProxyChannelRingBuffer
-
- org.jctools.channels.OffHeapFixedMessageSizeRingBuffer
-
- org.jctools.channels.spsc.SpscOffHeapFixedSizeRingBuffer
-
- org.jctools.channels.spsc.SpscChannelProducer<E>
-
- Type Parameters:
E
- element type.
- All Implemented Interfaces:
ChannelProducer<E>
public abstract class SpscChannelProducer<E> extends SpscOffHeapFixedSizeRingBuffer implements ChannelProducer<E>
Package Scoped: not part of public API.
-
-
Field Summary
Fields Modifier and Type Field Description protected long
pointer
-
Fields inherited from class org.jctools.channels.spsc.SpscOffHeapFixedSizeRingBuffer
EOF
-
Fields inherited from class org.jctools.channels.OffHeapFixedMessageSizeRingBuffer
bufferAddress, consumerIndexAddress, HEADER_SIZE, mask, MESSAGE_INDICATOR_SIZE, messageSize, producerIndexAddress, READ_ACQUIRE_INDICATOR, READ_RELEASE_INDICATOR, referenceMessageSize, references, WRITE_ACQUIRE_INDICATOR, WRITE_RELEASE_INDICATOR
-
-
Constructor Summary
Constructors Constructor Description SpscChannelProducer(java.nio.ByteBuffer buffer, int capacity, int messageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
claim()
Attempt to claim the next element in the channel.boolean
commit()
-
Methods inherited from class org.jctools.channels.spsc.SpscOffHeapFixedSizeRingBuffer
getLookaheadStep, readAcquire, readRelease, writeAcquire, writeRelease, writeRelease
-
Methods inherited from class org.jctools.channels.OffHeapFixedMessageSizeRingBuffer
arrayIndexForCursor, arrayIndexForCursor, capacity, consumerReferenceArrayIndex, createReferenceArray, getRequiredArraySize, getRequiredBufferSize, isEmpty, isReadReleased, lpConsumerIndex, lpProducerIndex, lvConsumerIndex, lvProducerIndex, offsetForIndex, offsetForIndex, producerReferenceArrayIndex, readAcquireState, readReference, readReleaseState, relativeIndexForOffset, relativeIndexForOffset, size, soConsumerIndex, soProducerIndex, writeAcquireState, writeReference, writeReleaseState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jctools.channels.ChannelProducer
currentElement
-
-
-
-
Method Detail
-
claim
public final boolean claim()
Description copied from interface:ChannelProducer
Attempt to claim the next element in the channel.- Specified by:
claim
in interfaceChannelProducer<E>
- Returns:
- true if claimed, false if there is insufficient space in the channel.
-
commit
public final boolean commit()
- Specified by:
commit
in interfaceChannelProducer<E>
- Returns:
- true if
-
-