Method: ConcurrentWorker::WorkerPool#deploy_worker

Defined in:
lib/concurrent_worker/workerpool.rb

#deploy_workerObject



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/concurrent_worker/workerpool.rb', line 121

def deploy_worker
  defined?(@work_block) || @work_block = nil
  worker_options = {
    type:                       @options[:type],
    snd_queue_max:              @snd_queue_max,
    result_callback_interrupt:  :never,
    retired_callback_interrupt: :never
  }
  w = Worker.new(*@args, worker_options, &@work_block)
  
  @set_blocks.each do |symbol, block|
    w.set_block(symbol, &block)
  end
  
  worker_pool_com_setting(w)
  w.run
  
  self.push(w)
  w
end