Skip to content

Instantly share code, notes, and snippets.

@kirs
Created September 19, 2017 13:22
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 kirs/abf3f723f759253eb80ba5e6729edfc9 to your computer and use it in GitHub Desktop.
Save kirs/abf3f723f759253eb80ba5e6729edfc9 to your computer and use it in GitHub Desktop.
require 'active_support/callbacks'
class Job
include ActiveSupport::Callbacks
define_callbacks :perform
set_callback :perform, :after, :save_omg
def perform
run_callbacks(:perform) do
raise SignalException.new("INT")
puts "performing"
end
end
# will not be invoked
def save_omg
puts "saving omg"
end
end
Job.new.perform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment