Module: Delayed::MessageSending
- Defined in:
- lib/delayed/message_sending.rb
Defined Under Namespace
Modules: ClassMethods
Classes: DelayProxy
Instance Method Summary
collapse
Instance Method Details
#__calculate_sender_for_delay ⇒ Object
107
108
109
110
111
|
# File 'lib/delayed/message_sending.rb', line 107
def __calculate_sender_for_delay
sender(1) if ::Rails.env.test? || ::Rails.env.development?
end
|
#delay(sender: nil, **enqueue_args) ⇒ Object
96
97
98
99
100
101
102
103
104
105
|
# File 'lib/delayed/message_sending.rb', line 96
def delay(sender: nil, **enqueue_args)
enqueue_args.each do |k, v|
enqueue_args[k] = v.call(self) if v.respond_to?(:call)
end
sender ||= __calculate_sender_for_delay
DelayProxy.new(self, sender: sender, **enqueue_args)
end
|