Module: SolidQueue::Job::Executable
- Extended by:
- ActiveSupport::Concern
- Included in:
- SolidQueue::Job
- Defined in:
- app/models/solid_queue/job/executable.rb
Instance Method Summary collapse
- #discard ⇒ Object
- #dispatch ⇒ Object
- #dispatch_bypassing_concurrency_limits ⇒ Object
- #finished! ⇒ Object
- #finished? ⇒ Boolean
- #prepare_for_execution ⇒ Object
- #status ⇒ Object
Instance Method Details
#discard ⇒ Object
103 104 105 |
# File 'app/models/solid_queue/job/executable.rb', line 103 def discard execution&.discard end |
#dispatch ⇒ Object
71 72 73 74 75 76 |
# File 'app/models/solid_queue/job/executable.rb', line 71 def dispatch if acquire_concurrency_lock then ready else handle_concurrency_conflict end end |
#dispatch_bypassing_concurrency_limits ⇒ Object
78 79 80 |
# File 'app/models/solid_queue/job/executable.rb', line 78 def dispatch_bypassing_concurrency_limits ready end |
#finished! ⇒ Object
82 83 84 85 86 87 88 89 |
# File 'app/models/solid_queue/job/executable.rb', line 82 def finished! if SolidQueue.preserve_finished_jobs? # update! rather than touch so the batch tracking callbacks run update!(finished_at: Time.current) else destroy! end end |
#finished? ⇒ Boolean
91 92 93 |
# File 'app/models/solid_queue/job/executable.rb', line 91 def finished? finished_at.present? end |
#prepare_for_execution ⇒ Object
64 65 66 67 68 69 |
# File 'app/models/solid_queue/job/executable.rb', line 64 def prepare_for_execution if due? then dispatch else schedule end end |
#status ⇒ Object
95 96 97 98 99 100 101 |
# File 'app/models/solid_queue/job/executable.rb', line 95 def status if finished? :finished elsif execution.present? execution.type end end |