Method: Contender::Pool::PoolExecutor#to_s

Defined in:
lib/contender/pool/pool_executor.rb

#to_sString

Returns:

  • (String)


321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/contender/pool/pool_executor.rb', line 321

def to_s
  state = current_control.state

  state_text = "Running" if state == RUNNING
  state_text = "Shutting down" if state > RUNNING && state < TERMINATED
  state_text = "Terminated" if state == TERMINATED

  "{#{state_text}" +
  ", pool size = #{current_size}" +
  ", active threads = #{active_count}" +
  ", queued tasks = #{backlog}" +
  ", completed tasks = #{completed_tasks}" +
  "}"
end