Module: Async::Background::Job::ClassMethods
- Defined in:
- lib/async/background/job.rb
Instance Method Summary collapse
- #options(**values) ⇒ Object
- #perform_async(*args, options: EMPTY_OPTIONS) ⇒ Object
- #perform_at(time, *args, options: EMPTY_OPTIONS) ⇒ Object
- #perform_in(delay, *args, options: EMPTY_OPTIONS) ⇒ Object
- #perform_now(*args) ⇒ Object
- #queue_options ⇒ Object
- #resolve_options ⇒ Object
Instance Method Details
#options(**values) ⇒ Object
63 64 65 |
# File 'lib/async/background/job.rb', line 63 def (**values) @options = Options.new(**values).to_h.compact end |
#perform_async(*args, options: EMPTY_OPTIONS) ⇒ Object
59 |
# File 'lib/async/background/job.rb', line 59 def perform_async(*args, options: EMPTY_OPTIONS) = Async::Background::Queue.enqueue(self, *args, options: ) |
#perform_at(time, *args, options: EMPTY_OPTIONS) ⇒ Object
61 |
# File 'lib/async/background/job.rb', line 61 def perform_at(time, *args, options: EMPTY_OPTIONS) = Async::Background::Queue.enqueue_at(time, self, *args, options: ) |
#perform_in(delay, *args, options: EMPTY_OPTIONS) ⇒ Object
60 |
# File 'lib/async/background/job.rb', line 60 def perform_in(delay, *args, options: EMPTY_OPTIONS) = Async::Background::Queue.enqueue_in(delay, self, *args, options: ) |
#perform_now(*args) ⇒ Object
57 |
# File 'lib/async/background/job.rb', line 57 def perform_now(*args) = new.perform(*args) |
#queue_options ⇒ Object
68 |
# File 'lib/async/background/job.rb', line 68 def = @options || EMPTY_OPTIONS |
#resolve_options ⇒ Object
67 |
# File 'lib/async/background/job.rb', line 67 def = @options || {} |