Class: ActiveJob::QueueAdapters::SqsAdapter::Params
- Inherits:
-
Object
- Object
- ActiveJob::QueueAdapters::SqsAdapter::Params
show all
- Defined in:
- lib/active_job/queue_adapters/sqs_adapter/params.rb
Overview
build request parameter of Aws::SQS::Client
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(job, body) ⇒ Params
Returns a new instance of Params.
18
19
20
21
|
# File 'lib/active_job/queue_adapters/sqs_adapter/params.rb', line 18
def initialize(job, body)
@job = job
@body = body || job.serialize
end
|
Class Method Details
.assured_delay_seconds(timestamp) ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/active_job/queue_adapters/sqs_adapter/params.rb', line 9
def assured_delay_seconds(timestamp)
delay = (timestamp - Time.now.to_f).floor
delay = 0 if delay.negative?
raise ArgumentError, 'Unable to queue a job with a delay great than 15 minutes' if delay > 15.minutes
delay
end
|
Instance Method Details
#entry ⇒ Object
27
28
29
30
31
32
33
|
# File 'lib/active_job/queue_adapters/sqs_adapter/params.rb', line 27
def entry
if Aws::Rails::SqsActiveJob.fifo?(queue_url)
default_entry.merge(options_for_fifo)
else
default_entry
end
end
|