# File lib/deep_test/distributed/dispatch_controller.rb, line 13
13:       def dispatch_with_options(method_name, options, *args)
14:         raise NoDispatchReceiversError if @receivers.empty?
15: 
16:         @options.ui_instance.dispatch_starting(method_name)
17: 
18:         threads = @receivers.map do |r|
19:           Thread.new do
20:             Thread.current[:receiver] = r
21:             Timeout.timeout(@options.timeout_in_seconds) do
22:               r.send method_name, *args
23:             end
24:           end
25:         end
26: 
27:         results = []
28:         threads.each do |t|
29:           begin
30:             results << t.value
31:           rescue Timeout::Error
32:             @receivers.delete t[:receiver]
33:             DeepTest.logger.error "Timeout dispatching #{method_name} to #{t[:receiver].__drburi}"
34:           rescue DRb::DRbConnError
35:             @receivers.delete t[:receiver]
36:             unless options[:ignore_connection_error]
37:               DeepTest.logger.error "Connection Refused dispatching #{method_name} to #{t[:receiver].__drburi}"
38:             end
39:           rescue Exception => e
40:             @receivers.delete t[:receiver]
41:             DeepTest.logger.error "Exception while dispatching #{method_name} to #{t[:receiver].__drburi} #{e.message}"
42:           end
43:         end
44: 
45:         results
46:       ensure
47:         @options.ui_instance.dispatch_finished(method_name)
48:       end