I am trying to do some calculations after doing all the promises. But it procnever calls:
cbr_promise = Concurrent::Promise.execute { CbrRatesService.call }
bitfinex_promise = Concurrent::Promise.execute { BitfinexService.call }
proc = Proc.new do
puts 10
end
Concurrent::Promise.all?([cbr_promise, bitfinex_promise]).then { proc }
Made with concurrent-rubygem.
Should I create a loop that will check this every 100 ms, for example?
Update
I tried to add a loop and execute the code (in sidekiqworker):
while @fl
Concurrent::Promise.all?([cbr_promise, bitfinex_promise]).then { proc }
end
but statefor all promises makes up pending. It may be due to beebug, but procnever calls anyway .
zishe source
share