🖥

#Rails ActiveJob の perform_later で遊んでみる

2019/09/11に公開

https://github.com/YumaInaura/rails-active-job-example/pull/1/files

# bundle exec rails runner this-script.rb

class SomeJob < ApplicationJob
  def perform(count)
    puts count
  end
end

1000.times do |i|
  SomeJob.perform_later(i)
end

sleep 1

実行

ところどころ順不同で処理されているのが分かる

bundle exec rails runner examples/random.rb

image

Original by Github issue

https://github.com/YumaInaura/YumaInaura/issues/2409

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

Twitter

https://twitter.com/YumaInaura

公開日時

2019-09-11

Discussion