diff --git a/akka-actor/src/main/java/akka/dispatch/AbstractBoundedNodeQueue.java b/akka-actor/src/main/java/akka/dispatch/AbstractBoundedNodeQueue.java index 4ae78fee31..305495fc06 100644 --- a/akka-actor/src/main/java/akka/dispatch/AbstractBoundedNodeQueue.java +++ b/akka-actor/src/main/java/akka/dispatch/AbstractBoundedNodeQueue.java @@ -9,7 +9,7 @@ import akka.util.Unsafe; import java.util.concurrent.atomic.AtomicReference; /** - * Lock-free bounded non-blocking multiple-producer multiple-consumer queue based on the works of: + * Lock-free bounded non-blocking multiple-producer single-consumer queue based on the works of: * * Andriy Plokhotnuyk (https://github.com/plokhotnyuk) * - https://github.com/plokhotnyuk/actors/blob/2e65abb7ce4cbfcb1b29c98ee99303d6ced6b01f/src/test/scala/akka/dispatch/Mailboxes.scala diff --git a/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala b/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala index a5689946b7..ff085f3c0d 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala @@ -386,7 +386,10 @@ class NodeMessageQueue extends AbstractNodeQueue[Envelope] with MessageQueue wit } } -//Discards overflowing messages into DeadLetters +/** + * Lock-free bounded non-blocking multiple-producer single-consumer queue. + * Discards overflowing messages into DeadLetters. + */ class BoundedNodeMessageQueue(capacity: Int) extends AbstractBoundedNodeQueue[Envelope](capacity) with MessageQueue with BoundedMessageQueueSemantics with MultipleConsumerSemantics { final def pushTimeOut: Duration = Duration.Undefined @@ -627,9 +630,11 @@ final case class SingleConsumerOnlyUnboundedMailbox() extends MailboxType with P } /** - * NonBlockingBoundedMailbox is a high-performance, multiple producer—multiple consumer, bounded MailboxType, + * NonBlockingBoundedMailbox is a high-performance, multiple-producer single-consumer, bounded MailboxType, * Noteworthy is that it discards overflow as DeadLetters. * + * It can't have multiple consumers, which rules out using it with BalancingPool (BalancingDispatcher) for instance. + * * NOTE: NonBlockingBoundedMailbox does not use `mailbox-push-timeout-time` as it is non-blocking. */ case class NonBlockingBoundedMailbox(val capacity: Int) extends MailboxType with ProducesMessageQueue[BoundedNodeMessageQueue] { diff --git a/akka-docs/rst/java/mailboxes.rst b/akka-docs/rst/java/mailboxes.rst index ebbd8c09a2..9549e32cf2 100644 --- a/akka-docs/rst/java/mailboxes.rst +++ b/akka-docs/rst/java/mailboxes.rst @@ -134,9 +134,9 @@ Akka comes shipped with a number of mailbox implementations: * **NonBlockingBoundedMailbox** - - Backed by a very efficient Multiple-Producer Multiple-Consumer queue + - Backed by a very efficient Multiple-Producer Single-Consumer queue - - Blocking: No + - Blocking: No (discards overflowing messages into deadLetters) - Bounded: Yes diff --git a/akka-docs/rst/scala/mailboxes.rst b/akka-docs/rst/scala/mailboxes.rst index 579aec8488..88574691de 100644 --- a/akka-docs/rst/scala/mailboxes.rst +++ b/akka-docs/rst/scala/mailboxes.rst @@ -134,9 +134,9 @@ Akka comes shipped with a number of mailbox implementations: * **NonBlockingBoundedMailbox** - - Backed by a very efficient Multiple-Producer Multiple-Consumer queue + - Backed by a very efficient Multiple-Producer Single-Consumer queue - - Blocking: No + - Blocking: No (discards overflowing messages into deadLetters) - Bounded: Yes