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 TypeMethodDescriptionint
capacity()
final Envelope
dequeue()
Try to dequeue the next message from this queue, return null failing that.void
Try to enqueue the message to this queue, or throw an exception.boolean
Indicates whether this queue is non-empty.int
Should return the current number of messages held in this queue; may always return 0 if no other value is available efficiently.scala.concurrent.duration.FiniteDuration
queue()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
controlQueue
in interfaceControlAwareMessageQueueSemantics
-
dequeue
Description copied from interface:MessageQueue
Try to dequeue the next message from this queue, return null failing that.- Specified by:
dequeue
in interfaceControlAwareMessageQueueSemantics
- Specified by:
dequeue
in interfaceMessageQueue
-
enqueue
Description copied from interface:MessageQueue
Try to enqueue the message to this queue, or throw an exception.- Specified by:
enqueue
in interfaceControlAwareMessageQueueSemantics
- Specified by:
enqueue
in interfaceMessageQueue
-
hasMessages
public boolean hasMessages()Description copied from interface:MessageQueue
Indicates whether this queue is non-empty.- Specified by:
hasMessages
in interfaceControlAwareMessageQueueSemantics
- Specified by:
hasMessages
in interfaceMessageQueue
- Specified by:
hasMessages
in interfaceQueueBasedMessageQueue
-
numberOfMessages
public int numberOfMessages()Description copied from interface:MessageQueue
Should 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, usehasMessages
instead.- Specified by:
numberOfMessages
in interfaceControlAwareMessageQueueSemantics
- Specified by:
numberOfMessages
in interfaceMessageQueue
- Specified by:
numberOfMessages
in interfaceQueueBasedMessageQueue
-
pushTimeOut
public scala.concurrent.duration.FiniteDuration pushTimeOut()- Specified by:
pushTimeOut
in interfaceBoundedMessageQueueSemantics
-
queue
- Specified by:
queue
in interfaceControlAwareMessageQueueSemantics
- Specified by:
queue
in interfaceQueueBasedMessageQueue
-