Class: ActiveJob::QueueAdapters::SqsAdapter::Params Private
- Inherits:
-
Object
- Object
- ActiveJob::QueueAdapters::SqsAdapter::Params
- Defined in:
- lib/active_job/queue_adapters/sqs_adapter/params.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Build request parameter of Aws::SQS::Client
Class Method Summary collapse
Instance Method Summary collapse
- #entry ⇒ Object private
-
#initialize(job, body) ⇒ Params
constructor
private
A new instance of Params.
- #queue_url ⇒ Object private
Constructor Details
#initialize(job, body) ⇒ Params
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Params.
19 20 21 22 |
# File 'lib/active_job/queue_adapters/sqs_adapter/params.rb', line 19 def initialize(job, body) @job = job @body = body || job.serialize end |
Class Method Details
.assured_delay_seconds(timestamp) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 |
# File 'lib/active_job/queue_adapters/sqs_adapter/params.rb', line 10 def assured_delay_seconds() delay = ( - 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
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 31 32 33 34 |
# File 'lib/active_job/queue_adapters/sqs_adapter/params.rb', line 28 def entry if Aws::ActiveJob::SQS.fifo?(queue_url) default_entry.merge() else default_entry end end |
#queue_url ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/active_job/queue_adapters/sqs_adapter/params.rb', line 24 def queue_url @queue_url ||= Aws::ActiveJob::SQS.config.queue_url_for(@job.queue_name) end |