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
99 100 101 |
# File 'app/models/solid_queue/job/executable.rb', line 99 def discard execution&.discard end |
#dispatch ⇒ Object
68 69 70 71 72 73 |
# File 'app/models/solid_queue/job/executable.rb', line 68 def dispatch if acquire_concurrency_lock then ready else handle_concurrency_conflict end end |
#dispatch_bypassing_concurrency_limits ⇒ Object
75 76 77 |
# File 'app/models/solid_queue/job/executable.rb', line 75 def dispatch_bypassing_concurrency_limits ready end |
#finished! ⇒ Object
79 80 81 82 83 84 85 |
# File 'app/models/solid_queue/job/executable.rb', line 79 def finished! if SolidQueue.preserve_finished_jobs? touch(:finished_at) else destroy! end end |
#finished? ⇒ Boolean
87 88 89 |
# File 'app/models/solid_queue/job/executable.rb', line 87 def finished? finished_at.present? end |
#prepare_for_execution ⇒ Object
61 62 63 64 65 66 |
# File 'app/models/solid_queue/job/executable.rb', line 61 def prepare_for_execution if due? then dispatch else schedule end end |
#status ⇒ Object
91 92 93 94 95 96 97 |
# File 'app/models/solid_queue/job/executable.rb', line 91 def status if finished? :finished elsif execution.present? execution.type end end |