I got a expensive calculation and i want to kill all childs once one of them delivers a result:
results = Parallel.find(1..32, in_processes: 32) do
this_could_take_long(1, 2)
end
p results #=> ["solution"]
Use case is solving a proof of work. One of the 16 processes will be the fastest and only one solution is needed. There seams to be no way to this or is ?
I got a expensive calculation and i want to kill all childs once one of them delivers a result:
Use case is solving a proof of work. One of the 16 processes will be the fastest and only one solution is needed. There seams to be no way to this or is ?