Added support hook for persistent mailboxes + cleanup and optimizations
This commit is contained in:
parent
021dd2d732
commit
9368ddc25d
8 changed files with 43 additions and 43 deletions
|
|
@ -89,12 +89,9 @@ class ExecutorBasedEventDrivenDispatcher(
|
|||
|
||||
override def mailboxSize(actorRef: ActorRef) = getMailbox(actorRef).size
|
||||
|
||||
override def register(actorRef: ActorRef) = {
|
||||
if (actorRef.mailbox eq null ) {
|
||||
if (mailboxCapacity <= 0) actorRef.mailbox = new ConcurrentLinkedQueue[MessageInvocation]
|
||||
else actorRef.mailbox = new LinkedBlockingQueue[MessageInvocation](mailboxCapacity)
|
||||
}
|
||||
super.register(actorRef)
|
||||
override def createMailbox(actorRef: ActorRef): AnyRef = {
|
||||
if (mailboxCapacity <= 0) new ConcurrentLinkedQueue[MessageInvocation]
|
||||
else new LinkedBlockingQueue[MessageInvocation](mailboxCapacity)
|
||||
}
|
||||
|
||||
def dispatch(receiver: ActorRef): Unit = if (active) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue