diff --git a/lib/sidekiq/client.rb b/lib/sidekiq/client.rb index 0b5d1532..e6b59a6a 100644 --- a/lib/sidekiq/client.rb +++ b/lib/sidekiq/client.rb @@ -65,22 +65,22 @@ module Sidekiq pushed ? item['jid'] : nil end - # Resque compatibility helpers. + # Resque compatibility helpers. # - # Example usage: - # Sidekiq::Client.enqueue(MyWorker, 'foo', 1, :bat => 'bar') + # Example usage: + # Sidekiq::Client.enqueue(MyWorker, 'foo', 1, :bat => 'bar') # # Messages are enqueued to the 'default' queue. # def self.enqueue(klass, *args) - klass.perform_async(*args) + klass.client_push('class' => self, 'args' => args) end - # Example usage: - # Sidekiq::Client.enqueue_to(:queue_name, MyWorker, 'foo', 1, :bat => 'bar') + # Example usage: + # Sidekiq::Client.enqueue_to(:queue_name, MyWorker, 'foo', 1, :bat => 'bar') # def self.enqueue_to(queue, klass, *args) - klass.perform_in_queue(queue, *args) + klass.client_push('queue' => queue, 'class' => self, 'args' => args) end end end diff --git a/lib/sidekiq/worker.rb b/lib/sidekiq/worker.rb index c798f076..95d8bd37 100644 --- a/lib/sidekiq/worker.rb +++ b/lib/sidekiq/worker.rb @@ -35,10 +35,6 @@ module Sidekiq client_push('class' => self, 'args' => args) end - def perform_in_queue(queue, *args) - client_push('queue' => queue, 'class' => self, 'args' => args) - end - def perform_in(interval, *args) int = interval.to_f ts = (int < 1_000_000_000 ? Time.now.to_f + int : int)