Making it possible to configure all-around stuff for the PinnedDispatcher
This commit is contained in:
parent
55f5cedd4e
commit
158bbabb58
2 changed files with 8 additions and 6 deletions
|
|
@ -190,7 +190,7 @@ class BalancingDispatcherConfigurator(config: Config, prerequisites: DispatcherP
|
|||
config.getInt("throughput"),
|
||||
Duration(config.getNanoseconds("throughput-deadline-time"), TimeUnit.NANOSECONDS),
|
||||
mailboxType,
|
||||
threadPoolConfig,
|
||||
threadPoolConfig.copy(corePoolSize = 1, maxPoolSize = 1),
|
||||
Duration(config.getMilliseconds("shutdown-timeout"), TimeUnit.MILLISECONDS))).build
|
||||
|
||||
/**
|
||||
|
|
@ -209,8 +209,9 @@ class PinnedDispatcherConfigurator(config: Config, prerequisites: DispatcherPrer
|
|||
/**
|
||||
* Creates new dispatcher for each invocation.
|
||||
*/
|
||||
override def dispatcher(): MessageDispatcher =
|
||||
new PinnedDispatcher(prerequisites, null, config.getString("name"), config.getString("id"), mailboxType,
|
||||
Duration(config.getMilliseconds("shutdown-timeout"), TimeUnit.MILLISECONDS))
|
||||
override def dispatcher(): MessageDispatcher = configureThreadPool(config,
|
||||
threadPoolConfig ⇒
|
||||
new PinnedDispatcher(prerequisites, null, config.getString("name"), config.getString("id"), mailboxType,
|
||||
Duration(config.getMilliseconds("shutdown-timeout"), TimeUnit.MILLISECONDS), threadPoolConfig)).build
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,14 +24,15 @@ class PinnedDispatcher(
|
|||
_name: String,
|
||||
_id: String,
|
||||
_mailboxType: MailboxType,
|
||||
_shutdownTimeout: Duration)
|
||||
_shutdownTimeout: Duration,
|
||||
_threadPoolConfig: ThreadPoolConfig = ThreadPoolConfig(allowCorePoolTimeout = true, corePoolSize = 1, maxPoolSize = 1))
|
||||
extends Dispatcher(_prerequisites,
|
||||
_name,
|
||||
_id,
|
||||
Int.MaxValue,
|
||||
Duration.Zero,
|
||||
_mailboxType,
|
||||
ThreadPoolConfig(allowCorePoolTimeout = true, corePoolSize = 1, maxPoolSize = 1),
|
||||
_threadPoolConfig,
|
||||
_shutdownTimeout) {
|
||||
|
||||
@volatile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue