lib/nonnative/pool.rb in nonnative-1.66.0 vs lib/nonnative/pool.rb in nonnative-1.67.0
- old
+ new
@@ -4,17 +4,17 @@
class Pool
def initialize(configuration)
@configuration = configuration
end
- def start(&block)
+ def start(&)
services.each(&:start)
- [servers, processes].each { |t| process(t, :start, :open?, &block) }
+ [servers, processes].each { |t| process(t, :start, :open?, &) }
end
- def stop(&block)
- [processes, servers].each { |t| process(t, :stop, :closed?, &block) }
+ def stop(&)
+ [processes, servers].each { |t| process(t, :stop, :closed?, &) }
services.each(&:stop)
end
def process_by_name(name)
processes[runner_index(configuration.processes, name)].first
@@ -53,11 +53,11 @@
def services
@services ||= configuration.services.map { |s| Nonnative::Service.new(s) }
end
- def process(all, type_method, port_method, &block)
+ def process(all, type_method, port_method, &)
types = []
pids = []
threads = []
all.each do |type, port|
@@ -66,10 +66,10 @@
threads << Thread.new { port.send(port_method) }
end
ports = threads.map(&:value)
- yield_results(types, pids, ports, &block)
+ yield_results(types, pids, ports, &)
end
def yield_results(all, pids, ports)
all.zip(pids, ports).each do |type, id, result|
yield type.name, id, result