require 'qujo/queue/resque/job_worker' require 'qujo/queue/resque/schedule_worker' module Qujo module Queue module Resque extend ActiveSupport::Concern included do def enqueue raise Qujo::Exceptions::ResqueNotLoaded unless defined?(::Resque) ::Resque.enqueue(Qujo::Queue::Resque::JobWorker, {id: self.id.to_s}) end def enqueue_in(seconds) raise Qujo::Exceptions::ResqueNotLoaded unless defined?(::Resque) raise Qujo::Exceptions::ResqueSchedulerNotLoaded unless defined?(::Resque::Scheduler) ::Resque.enqueue_in(seconds, Qujo::Queue::Resque::JobWorker, {id: self.id.to_s}) end def enqueue_at(time) raise Qujo::Exceptions::ResqueNotLoaded unless defined?(::Resque) raise Qujo::Exceptions::ResqueSchedulerNotLoaded unless defined?(::Resque::Scheduler) ::Resque.enqueue_at(time, Qujo::Queue::Resque::JobWorker, {id: self.id.to_s}) end end end end end