class InParallel::InParallelExecutor::BlankBindingParallelProxy
Proxy class used to wrap each method execution in a block and run it in parallel A block from Parallel.run_in_parallel is executed with a binding of an instance of this class
Public Class Methods
new(obj)
click to toggle source
# File lib/in_parallel.rb, line 312 def initialize(obj) @object = obj @result_id = 0 end
Public Instance Methods
method_missing(method_sym, *args, &block)
click to toggle source
All methods within the block should show up as missing (unless defined in :Kernel)
# File lib/in_parallel.rb, line 318 def method_missing(method_sym, *args, &block) if InParallelExecutor.main_pid == ::Process.pid out = InParallelExecutor._execute_in_parallel("'#{method_sym.to_s}' #{caller[0].to_s}", @object.eval('self')) { send(method_sym, *args, &block) } out[:tmp_result] end end