Skip to content

Instantly share code, notes, and snippets.

@kenzotakahashi
Created August 20, 2016 01:15
Show Gist options
  • Save kenzotakahashi/3947b270016424a634b63f9ac9a893d4 to your computer and use it in GitHub Desktop.
Save kenzotakahashi/3947b270016424a634b63f9ac9a893d4 to your computer and use it in GitHub Desktop.
#week3/plactice/app/jobs/pokemon/pokemon_job.rb
module Pokemon
class PokemonJob < ApplicationJob
queue_as :default
def perform(*args)
puts "ポケモンGO!"
end
end
end
#week3/plactice/lib/tasks/pokemon.rake
namespace :pokemon do
desc 'Say Pokemon!'
task hello_world: :environment do
# (1..100000).each do
(1..10).each do
Pokemon::PokemonJob.perform_later
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment