Adding support for mailboxIsEmpty on MessageDispatcher and removing getMailboxSize and mailboxSize from ActorRef, use actorref.dispatcher.mailboxSize(actorref) and actorref.dispatcher.mailboxIsEmpty(actorref)
This commit is contained in:
parent
ed5ac01d72
commit
417fcc779d
6 changed files with 14 additions and 15 deletions
|
|
@ -135,6 +135,8 @@ class CallingThreadDispatcher(val warnings: Boolean = true) extends MessageDispa
|
|||
|
||||
override def mailboxSize(actor: ActorRef) = getMailbox(actor).queue.size
|
||||
|
||||
def mailboxIsEmpty(actorRef: ActorRef): Boolean = getMailbox(actorRef).queue.isEmpty
|
||||
|
||||
private[akka] override def dispatch(handle: MessageInvocation) {
|
||||
val mbox = getMailbox(handle.receiver)
|
||||
val queue = mbox.queue
|
||||
|
|
@ -210,6 +212,7 @@ class CallingThreadDispatcher(val warnings: Boolean = true) extends MessageDispa
|
|||
class NestingQueue {
|
||||
private var q = new LinkedList[MessageInvocation]()
|
||||
def size = q.size
|
||||
def isEmpty = q.isEmpty
|
||||
def push(handle: MessageInvocation) { q.offer(handle) }
|
||||
def peek = q.peek
|
||||
def pop = q.poll
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue