Package org.apache.pekko.dispatch
Class BoundedControlAwareMailbox.MessageQueue
java.lang.Object
org.apache.pekko.dispatch.BoundedControlAwareMailbox.MessageQueue
- All Implemented Interfaces:
Serializable,BoundedControlAwareMessageQueueSemantics,BoundedMessageQueueSemantics,ControlAwareMessageQueueSemantics,MessageQueue,MultipleConsumerSemantics,QueueBasedMessageQueue
- Enclosing class:
- BoundedControlAwareMailbox
public static class BoundedControlAwareMailbox.MessageQueue
extends Object
implements BoundedControlAwareMessageQueueSemantics, Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageQueue(int capacity, scala.concurrent.duration.FiniteDuration pushTimeOut) -
Method Summary
Modifier and TypeMethodDescriptionintcapacity()final Envelopedequeue()Try to dequeue the next message from this queue, return null failing that.voidTry to enqueue the message to this queue, or throw an exception.booleanIndicates whether this queue is non-empty.intShould return the current number of messages held in this queue; may always return 0 if no other value is available efficiently.scala.concurrent.duration.FiniteDurationqueue()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.dispatch.QueueBasedMessageQueue
cleanUp
-
Constructor Details
-
MessageQueue
public MessageQueue(int capacity, scala.concurrent.duration.FiniteDuration pushTimeOut)
-
-
Method Details
-
capacity
public int capacity() -
controlQueue
- Specified by:
controlQueuein interfaceControlAwareMessageQueueSemantics
-
dequeue
Description copied from interface:MessageQueueTry to dequeue the next message from this queue, return null failing that.- Specified by:
dequeuein interfaceControlAwareMessageQueueSemantics- Specified by:
dequeuein interfaceMessageQueue
-
enqueue
Description copied from interface:MessageQueueTry to enqueue the message to this queue, or throw an exception.- Specified by:
enqueuein interfaceControlAwareMessageQueueSemantics- Specified by:
enqueuein interfaceMessageQueue
-
hasMessages
public boolean hasMessages()Description copied from interface:MessageQueueIndicates whether this queue is non-empty.- Specified by:
hasMessagesin interfaceControlAwareMessageQueueSemantics- Specified by:
hasMessagesin interfaceMessageQueue- Specified by:
hasMessagesin interfaceQueueBasedMessageQueue
-
numberOfMessages
public int numberOfMessages()Description copied from interface:MessageQueueShould return the current number of messages held in this queue; may always return 0 if no other value is available efficiently. Do not use this for testing for presence of messages, usehasMessagesinstead.- Specified by:
numberOfMessagesin interfaceControlAwareMessageQueueSemantics- Specified by:
numberOfMessagesin interfaceMessageQueue- Specified by:
numberOfMessagesin interfaceQueueBasedMessageQueue
-
pushTimeOut
public scala.concurrent.duration.FiniteDuration pushTimeOut()- Specified by:
pushTimeOutin interfaceBoundedMessageQueueSemantics
-
queue
- Specified by:
queuein interfaceControlAwareMessageQueueSemantics- Specified by:
queuein interfaceQueueBasedMessageQueue
-