lib/bolt/executor.rb in bolt-0.22.0 vs lib/bolt/executor.rb in bolt-0.23.0
- old
+ new
@@ -38,10 +38,14 @@
end
@reported_transports = Set.new
@noop = noop
@run_as = nil
- @pool = Concurrent::ThreadPoolExecutor.new(max_threads: concurrency)
+ @pool = if concurrency > 0
+ Concurrent::ThreadPoolExecutor.new(max_threads: concurrency)
+ else
+ Concurrent.global_immediate_executor
+ end
@logger.debug { "Started with #{concurrency} max thread(s)" }
@notifier = Bolt::Notifier.new
end
def transport(transport)