Skip to content

Instantly share code, notes, and snippets.

@ixti
Last active August 13, 2019 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ixti/32c9fabe344de46c9986228aa18de253 to your computer and use it in GitHub Desktop.
Save ixti/32c9fabe344de46c9986228aa18de253 to your computer and use it in GitHub Desktop.
class ExampleJob < ApplicationJob
STEPS = [
{ :band => "The Baboon Show" },
{ :band => "Blowfuse" },
{ :band => "CRIM" }
].each(&:freeze).freeze
def perform(options)
time = Time.at(options.fetch(:timestamp))
STEPS.each do |step_options|
sleep(rand(5..5))
ReleaseRadar.new(:time => time, **step_options).call
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment