Removing bounded executors since they have probably never been used, also, removing possibility to specify own RejectedExecutionHandler since Akka needs to know what to do there anyway. Implementing a sane version of CallerRuns
This commit is contained in:
parent
13647b2b61
commit
727c7de58d
8 changed files with 21 additions and 85 deletions
|
|
@ -354,7 +354,6 @@ abstract class MessageDispatcherConfigurator(val app: ActorSystem) {
|
|||
conf_?(config getInt "keep-alive-time")(time ⇒ _.setKeepAliveTime(Duration(time, app.AkkaConfig.DefaultTimeUnit))),
|
||||
conf_?(config getDouble "core-pool-size-factor")(factor ⇒ _.setCorePoolSizeFromFactor(factor)),
|
||||
conf_?(config getDouble "max-pool-size-factor")(factor ⇒ _.setMaxPoolSizeFromFactor(factor)),
|
||||
conf_?(config getInt "executor-bounds")(bounds ⇒ _.setExecutorBounds(bounds)),
|
||||
conf_?(config getBool "allow-core-timeout")(allow ⇒ _.setAllowCoreThreadTimeout(allow)),
|
||||
conf_?(config getInt "task-queue-size" flatMap {
|
||||
case size if size > 0 ⇒
|
||||
|
|
@ -364,13 +363,6 @@ abstract class MessageDispatcherConfigurator(val app: ActorSystem) {
|
|||
case x ⇒ throw new IllegalArgumentException("[%s] is not a valid task-queue-type [array|linked]!" format x)
|
||||
}
|
||||
case _ ⇒ None
|
||||
})(queueFactory ⇒ _.setQueueFactory(queueFactory)),
|
||||
conf_?(config getString "rejection-policy" map {
|
||||
case "abort" ⇒ new AbortPolicy()
|
||||
case "caller-runs" ⇒ new CallerRunsPolicy()
|
||||
case "discard-oldest" ⇒ new DiscardOldestPolicy()
|
||||
case "discard" ⇒ new DiscardPolicy()
|
||||
case x ⇒ throw new IllegalArgumentException("[%s] is not a valid rejectionPolicy [abort|caller-runs|discard-oldest|discard]!" format x)
|
||||
})(policy ⇒ _.setRejectionPolicy(policy)))
|
||||
})(queueFactory ⇒ _.setQueueFactory(queueFactory)))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue