首先,在您要鏈接到未發佈的Akka版本快照文檔(即快照)的情況下,請始終使用您正在使用的版本的文檔。
這裏的2.1.2文檔:http://doc.akka.io/docs/akka/2.1.2/scala/dispatchers.html(也doc.akka.io訪問)
當我們看那個頁面,我們可以看到下的fork-join-執行和線程例如配置-pool執行人它說:「更多選項,請參閱配置的默認調度部分。」,鏈接:
我們在哪裏可以找到:
# This will be used if you have set "executor = "thread-pool-executor""
thread-pool-executor {
# Keep alive time for threads
keep-alive-time = 60s
# Min number of threads to cap factor-based core number to
core-pool-size-min = 8
# The core pool size factor is used to determine thread pool core size
# using the following formula: ceil(available processors * factor).
# Resulting size is then bounded by the core-pool-size-min and
# core-pool-size-max values.
core-pool-size-factor = 3.0
# Max number of threads to cap factor-based number to
core-pool-size-max = 64
# Minimum number of threads to cap factor-based max number to
# (if using a bounded task queue)
max-pool-size-min = 8
# Max no of threads (if using a bounded task queue) is determined by
# calculating: ceil(available processors * factor)
max-pool-size-factor = 3.0
# Max number of threads to cap factor-based max number to
# (if using a bounded task queue)
max-pool-size-max = 64
# Specifies the bounded capacity of the task queue (< 1 == unbounded)
task-queue-size = -1
# Specifies which type of task queue will be used, can be "array" or
# "linked" (default)
task-queue-type = "linked"
# Allow core threads to time out
allow-core-timeout = on
}
因此得出結論,您需要設置defau lt-dispatcher使用"thread-pool-executor"
如果要使用ThreadPoolExecutor,則使用akka.default-dispatcher.executor = "thread-pool-executor"
,然後指定該線程池執行程序的配置。
這有幫助嗎?
乾杯, √
AMM,我不想改變執行者,僅僅調整了默認的一個作爲例子Play的配置 - 我只是想知道,爲什麼對遊戲2.1的文檔從播放不同2.0 - 無論是真正的API更改,還是文檔錯誤。無論如何,我只想設置'core-pool-size-max'或'pool-size-max'。 – ripper234 2013-05-12 15:17:15
但是您需要更改正確實施的設置。默認調度程序使用fork-join-executor,因此除非更改執行程序,否則必須更改設置。請參閱文檔。 – 2013-05-12 20:37:44