Method: Updater::ORM::ClassMethods#lock_next
- Defined in:
- lib/updater/orm/orm.rb
#lock_next(worker) ⇒ Object
Locks to a worker and returns a job that is ready to run. Workers will call this when they are ready for another job. In general it should lock jobs in the order they were recieved or scheduled, but strict ordering is not a requirement. (c.f. delayed_job). If there are current jobs, this method MUST return one which has been locked successfully, internally trying successive current jobs if the first one fails to lock. It MUST NOT raise an error or return nil if the datastore is temerarly busy. Instead it must wait until it can either get access to and lock a record, or prove that no jobs are current.
In the event that there are no current jobs left in the datastore this method should retunr nil. The should inturperate this as a sign that the queue is empty and consult queue_time to determine how long to wait for the next job.
203 204 205 |
# File 'lib/updater/orm/orm.rb', line 203 def lock_next(worker) NotImplementedError end |