Module | Resque::Scheduler::DelayingExtensions |
In: |
lib/resque/scheduler/delaying_extensions.rb
|
Discover if a job has been delayed. Examples
Resque.delayed?(MyJob) Resque.delayed?(MyJob, id: 1)
Returns true if the job has been delayed
Used internally to stuff the item into the schedule sorted list. timestamp can be either in seconds or a datetime object Insertion if O(log(n)). Returns true if it‘s the first job to be scheduled at that time, else false
This method is nearly identical to enqueue only it also takes a timestamp which will be used to schedule the job for queueing. Until timestamp is in the past, the job will sit in the schedule list.
Identical to enqueue_at, except you can also specify a queue in which the job will be placed after the timestamp has passed. It respects Resque.inline option, by creating the job right away instead of adding to the queue.
Given a block, enqueue jobs now that return true from a block
This allows for enqueuing of delayed jobs that have arguments matching certain criteria
Identical to enqueue_at but takes number_of_seconds_from_now instead of a timestamp.
Identical to enqueue_in, except you can also specify a queue in which the job will be placed after the number of seconds has passed.
Given a block, find jobs that return true from a block
This allows for finding of delayed jobs that have arguments matching certain criteria
Returns the next item to be processed for a given timestamp, nil if done. (don‘t call directly) timestamp can either be in seconds or a datetime
Given a timestamp and job (klass + args) it removes all instances and returns the count of jobs removed.
O(N) where N is the number of jobs scheduled to fire at the given timestamp