=act #17425 Document NonBlockingBoundedMailbox to be single-consumer

This commit is contained in:
Patrik Nordwall 2015-09-11 09:00:03 +02:00
parent a22b3be9da
commit 876b8045a1
4 changed files with 12 additions and 7 deletions

View file

@ -9,7 +9,7 @@ import akka.util.Unsafe;
import java.util.concurrent.atomic.AtomicReference; 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) * Andriy Plokhotnuyk (https://github.com/plokhotnyuk)
* - https://github.com/plokhotnyuk/actors/blob/2e65abb7ce4cbfcb1b29c98ee99303d6ced6b01f/src/test/scala/akka/dispatch/Mailboxes.scala * - https://github.com/plokhotnyuk/actors/blob/2e65abb7ce4cbfcb1b29c98ee99303d6ced6b01f/src/test/scala/akka/dispatch/Mailboxes.scala

View file

@ -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) class BoundedNodeMessageQueue(capacity: Int) extends AbstractBoundedNodeQueue[Envelope](capacity)
with MessageQueue with BoundedMessageQueueSemantics with MultipleConsumerSemantics { with MessageQueue with BoundedMessageQueueSemantics with MultipleConsumerSemantics {
final def pushTimeOut: Duration = Duration.Undefined final def pushTimeOut: Duration = Duration.Undefined
@ -627,9 +630,11 @@ final case class SingleConsumerOnlyUnboundedMailbox() extends MailboxType with P
} }
/** /**
* NonBlockingBoundedMailbox is a high-performance, multiple producermultiple consumer, bounded MailboxType, * NonBlockingBoundedMailbox is a high-performance, multiple-producer single-consumer, bounded MailboxType,
* Noteworthy is that it discards overflow as DeadLetters. * 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. * 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] { case class NonBlockingBoundedMailbox(val capacity: Int) extends MailboxType with ProducesMessageQueue[BoundedNodeMessageQueue] {

View file

@ -134,9 +134,9 @@ Akka comes shipped with a number of mailbox implementations:
* **NonBlockingBoundedMailbox** * **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 - Bounded: Yes

View file

@ -134,9 +134,9 @@ Akka comes shipped with a number of mailbox implementations:
* **NonBlockingBoundedMailbox** * **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 - Bounded: Yes