Switching ThreadBasedDispatcher to use SynchronousQueue since only one actor should be in it
This commit is contained in:
parent
5ba947cfd6
commit
36a612eea5
1 changed files with 7 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ import akka.config.Config.config
|
|||
import akka.util.Duration
|
||||
|
||||
import java.util.Queue
|
||||
import java.util.concurrent.{ConcurrentLinkedQueue, BlockingQueue, TimeUnit, LinkedBlockingQueue}
|
||||
import java.util.concurrent.{TimeUnit, SynchronousQueue}
|
||||
import akka.actor
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
|
|
@ -47,6 +47,11 @@ class ThreadBasedDispatcher(_actor: ActorRef, _mailboxType: MailboxType)
|
|||
}
|
||||
|
||||
object ThreadBasedDispatcher {
|
||||
val oneThread: ThreadPoolConfig = ThreadPoolConfig(allowCorePoolTimeout = true, corePoolSize = 1, maxPoolSize = 1)
|
||||
val oneThread: ThreadPoolConfig =
|
||||
ThreadPoolConfig(
|
||||
allowCorePoolTimeout = true,
|
||||
corePoolSize = 1,
|
||||
maxPoolSize = 1,
|
||||
queueFactory = () => new SynchronousQueue[Runnable])
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue