require 'concurrent-ruby'

rediculously_large_number = 25_000

counter = Concurrent::AtomicFixnum.new(0)

rediculously_large_number.times do |iter|
  puts "Iter #{iter}" if iter % 1000 == 0
  Concurrent::Promises.future(counter) do
    sleep rand(5..15)
    counter.increment
  end
end

puts "waiting on futures"
while counter.value < futures
  puts counter.value
  sleep 1
end
