AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: ActiveJob::QueueAdapters::AmazonSqsAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_job/queue_adapters/amazon_sqs_adapter.rb

Direct Known Subclasses

AmazonSqsAsyncAdapter

Instance Method Summary collapse

Instance Method Details

#enqueue(job) ⇒ Object



10
11
12
# File 'lib/active_job/queue_adapters/amazon_sqs_adapter.rb', line 10

def enqueue(job)
  _enqueue(job)
end

#enqueue_at(job, timestamp, opts = {}) ⇒ Object

Raises:

  • (ArgumentError)


14
15
16
17
18
# File 'lib/active_job/queue_adapters/amazon_sqs_adapter.rb', line 14

def enqueue_at(job, timestamp, opts={})
  delay = (timestamp - Time.now.to_f).floor
  raise ArgumentError, 'Unable to queue a job with a delay great than 15 minutes' if delay > 15.minutes
  _enqueue(job, delay_seconds: delay)
end