From e084d5bd7aaa113f29b4ea8d0f2305daeae33826 Mon Sep 17 00:00:00 2001 From: Cristian Bica Date: Fri, 22 Aug 2014 17:44:48 +0300 Subject: [PATCH] Implemented enqueue_at for ActiveJob's Backburner adapter --- .../lib/active_job/queue_adapters/backburner_adapter.rb | 3 ++- guides/source/active_job_basics.md | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/activejob/lib/active_job/queue_adapters/backburner_adapter.rb b/activejob/lib/active_job/queue_adapters/backburner_adapter.rb index 6fe2d4eb53..8d34155645 100644 --- a/activejob/lib/active_job/queue_adapters/backburner_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/backburner_adapter.rb @@ -9,7 +9,8 @@ module ActiveJob end def enqueue_at(job, timestamp, *args) - raise NotImplementedError + delay = Time.current.to_f - timestamp + Backburner::Worker.enqueue JobWrapper, [ job.name, *args ], queue: job.queue_name, delay: delay end end diff --git a/guides/source/active_job_basics.md b/guides/source/active_job_basics.md index 58e828d1b5..34257c895e 100644 --- a/guides/source/active_job_basics.md +++ b/guides/source/active_job_basics.md @@ -105,8 +105,8 @@ Active Job has adapters for the following queueing backends: * [Delayed Job](https://github.com/collectiveidea/delayed_job) * [Qu](https://github.com/bkeepers/qu) * [Que](https://github.com/chanks/que) -* [QueueClassic](https://github.com/ryandotsmith/queue_classic) -* [Resque 1.x](https://github.com/resque/resque) +* [QueueClassic 2.x](https://github.com/ryandotsmith/queue_classic/tree/v2.2.3) +* [Resque 1.x](https://github.com/resque/resque/tree/1-x-stable) * [Sidekiq](https://github.com/mperham/sidekiq) * [Sneakers](https://github.com/jondot/sneakers) * [Sucker Punch](https://github.com/brandonhilkert/sucker_punch) @@ -119,12 +119,12 @@ Active Job has adapters for the following queueing backends: | **Delayed Job** | Yes | Yes | Yes | Job | Global | Global | | **Que** | Yes | Yes | Yes | Job | No | Job | | **Queue Classic** | Yes | Yes | Gem | No | No | No | -| **Resque** | Yes | Yes | Gem | Queue | Global | ? | +| **Resque** | Yes | Yes | Gem | Queue | Global | Yes | | **Sidekiq** | Yes | Yes | Yes | Queue | No | Job | | **Sneakers** | Yes | Yes | No | Queue | Queue | No | | **Sucker Punch** | Yes | Yes | Yes | No | No | No | -| **Active Job** | Yes | Yes | WIP | No | No | No | | **Active Job Inline** | No | Yes | N/A | N/A | N/A | N/A | +| **Active Job** | Yes | Yes | Yes | No | No | No | ### Change Backends