我可以改变赛璐珞监管组的水池大小吗?
例如,我有一名工人:
class Worker
include Celluloid
def do
puts self.inspect
end
end
然后我在一个监督小组中安排了3名工人:
supervisor = Celluloid::SupervisionGroup.run!
supervisor.pool(Worker, size: 3, as: :worker)
我可以以某种方式修改supervisor
中的池大小吗?
感谢。
答案 0 :(得分:0)
确定。发现它:
supervisor = Celluloid::SupervisionGroup.run!
pool = supervisor.pool(Worker, size: 3, as: :worker) # Number of workers = 3
...
pool.size = 2 # Change number of pooled workers from 3 to 2