Class MpscChannel<E>
java.lang.Object
org.jctools.channels.mpsc.MpscChannel<E>
- All Implemented Interfaces:
Channel<E>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufferprivate static final booleanprivate final intprivate final intprivate final MpscChannelProducer<E> private final int -
Constructor Summary
ConstructorsConstructorDescriptionMpscChannel(ByteBuffer buffer, int requestedCapacity, Class<E> type) This is to be used for an IPC queue with the direct buffer used being a memory mapped file. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidconsumer(ChannelReceiver<E> receiver) private intgetMaximumCapacity(int requestedCapacity) booleanisEmpty()intprivate MpscChannelConsumer<E> newConsumer(Object... args) private MpscChannelProducer<E> newProducer(Class<E> type, Object... args) producer()intintsize()Get the number of elements in the queue.
-
Field Details
-
debugEnabled
private static final boolean debugEnabled- See Also:
-
elementSize
private final int elementSize -
mapper
-
buffer
-
maximumCapacity
private final int maximumCapacity -
requestedCapacity
private final int requestedCapacity -
producer
-
-
Constructor Details
-
MpscChannel
This is to be used for an IPC queue with the direct buffer used being a memory mapped file.- Parameters:
buffer-requestedCapacity-
-
-
Method Details
-
getMaximumCapacity
private int getMaximumCapacity(int requestedCapacity) -
checkByteBuffer
private void checkByteBuffer() -
checkSufficientCapacity
private void checkSufficientCapacity() -
consumer
-
producer
-
size
-
maximumCapacity
public int maximumCapacity()- Specified by:
maximumCapacityin interfaceChannel<E>- Returns:
- the maximum number of elements that can fit in this channel.
-
requestedCapacity
public int requestedCapacity()- Specified by:
requestedCapacityin interfaceChannel<E>- Returns:
- The requested maximum number of elements that can fit in this channel.
-
isEmpty
-
newProducer
-
newConsumer
-