Skip to content
Newer
Older
100644 17 lines (16 sloc) 510 Bytes
75b49dc @tobi Initial extraction
authored
1 module Delayed
2 module MessageSending
0581928 @technoweenie remove excess whitespace
technoweenie authored
3 def send_later(method, *args)
75b49dc @tobi Initial extraction
authored
4 Delayed::Job.enqueue Delayed::PerformableMethod.new(self, method.to_sym, args)
5 end
dbc5e37 @tobi Added Module#handle_asynchronously that allows you to mark methods fo…
authored
6
7 module ClassMethods
8 def handle_asynchronously(method)
9 without_name = "#{method}_without_send_later"
10 define_method("#{method}_with_send_later") do |*args|
11 send_later(without_name, *args)
12 end
13 alias_method_chain method, :send_later
14 end
15 end
16 end
75b49dc @tobi Initial extraction
authored
17 end
Something went wrong with that request. Please try again.