Package org.apache.pulsar.client.impl
Class ProducerImpl.OpSendMsgQueue
- java.lang.Object
-
- org.apache.pulsar.client.impl.ProducerImpl.OpSendMsgQueue
-
- All Implemented Interfaces:
java.lang.Iterable<ProducerImpl.OpSendMsg>
- Enclosing class:
- ProducerImpl<T>
protected static class ProducerImpl.OpSendMsgQueue extends java.lang.Object implements java.lang.Iterable<ProducerImpl.OpSendMsg>
Queue implementation that is used as the pending messages queue. This implementation postpones adding of new OpSendMsg entries that happen while the forEach call is in progress. This is needed for preventing ConcurrentModificationExceptions that would occur when the forEach action calls the add method via a callback in user code. This queue is not thread safe.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOpSendMsgQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(ProducerImpl.OpSendMsg o)voidclear()voidforEach(java.util.function.Consumer<? super ProducerImpl.OpSendMsg> action)java.util.Iterator<ProducerImpl.OpSendMsg>iterator()intmessagesCount()ProducerImpl.OpSendMsgpeek()voidremove()
-
-
-
Method Detail
-
forEach
public void forEach(java.util.function.Consumer<? super ProducerImpl.OpSendMsg> action)
- Specified by:
forEachin interfacejava.lang.Iterable<ProducerImpl.OpSendMsg>
-
add
public boolean add(ProducerImpl.OpSendMsg o)
-
clear
public void clear()
-
remove
public void remove()
-
peek
public ProducerImpl.OpSendMsg peek()
-
messagesCount
public int messagesCount()
-
iterator
public java.util.Iterator<ProducerImpl.OpSendMsg> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<ProducerImpl.OpSendMsg>
-
-