use config.getBytes where appropriate
This commit is contained in:
parent
77675383f4
commit
c8f8b55f01
2 changed files with 9 additions and 3 deletions
|
|
@ -52,7 +52,7 @@ akka {
|
|||
|
||||
# The number of bytes per direct buffer in the pool used to read or write
|
||||
# network data from the kernel.
|
||||
direct-buffer-size = 131072 # 128 KiB
|
||||
direct-buffer-size = 128 KiB
|
||||
|
||||
# The maximal number of direct buffers kept in the direct buffer pool for
|
||||
# reuse.
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ class TcpExt(system: ExtendedActorSystem) extends IO.Extension {
|
|||
}
|
||||
val SelectorAssociationRetries = getInt("selector-association-retries")
|
||||
val BatchAcceptLimit = getInt("batch-accept-limit")
|
||||
val DirectBufferSize = getInt("direct-buffer-size")
|
||||
val DirectBufferSize = getIntBytes("direct-buffer-size")
|
||||
val MaxDirectBufferPoolSize = getInt("max-direct-buffer-pool-size")
|
||||
val RegisterTimeout = getString("register-timeout") match {
|
||||
case "infinite" ⇒ Duration.Undefined
|
||||
|
|
@ -201,7 +201,7 @@ class TcpExt(system: ExtendedActorSystem) extends IO.Extension {
|
|||
}
|
||||
val ReceivedMessageSizeLimit = getString("received-message-size-limit") match {
|
||||
case "unlimited" ⇒ Int.MaxValue
|
||||
case x ⇒ getInt("received-message-size-limit")
|
||||
case x ⇒ getIntBytes("received-message-size-limit")
|
||||
}
|
||||
val SelectorDispatcher = getString("selector-dispatcher")
|
||||
val WorkerDispatcher = getString("worker-dispatcher")
|
||||
|
|
@ -215,6 +215,12 @@ class TcpExt(system: ExtendedActorSystem) extends IO.Extension {
|
|||
require(BatchAcceptLimit > 0, "batch-accept-limit must be > 0")
|
||||
|
||||
val MaxChannelsPerSelector = if (MaxChannels == -1) -1 else math.max(MaxChannels / NrOfSelectors, 1)
|
||||
|
||||
private[this] def getIntBytes(path: String): Int = {
|
||||
val size = getBytes(path)
|
||||
require(size < Int.MaxValue, s"$path must be < 2 GiB")
|
||||
size.toInt
|
||||
}
|
||||
}
|
||||
|
||||
val manager = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue