Module Resque::Scheduler::DelayingExtensions
In: lib/resque/scheduler/delaying_extensions.rb

Methods

Public Instance methods

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

Returns an array of timestamps based on start and count

Returns the size of the delayed queue schedule

Returns an array of delayed items for the given timestamp

Returns the number of jobs for a given timestamp in the delayed queue schedule

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 an encoded item, enqueue it now

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 delayed queue timestamp (don‘t call directly)

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 an encoded item, remove it from the delayed_queue

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

Given a block, remove jobs that return true from a block

This allows for removal of delayed jobs that have arguments matching certain criteria

Clears all jobs created with enqueue_at or enqueue_in

Returns delayed jobs schedule timestamp for klass, args.

[Validate]