From 68c643f8e70084d89f7bddff2b863b6b83411f4a Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Mon, 18 Aug 2014 08:17:36 +0000 Subject: [ActiveJob] Add queue_name_prefix so all queue are prefixed . We can split queues on a per environement basis as well as seggregate per application so we can split queues on a per env basis ActiveJob::Base.queue_name_prefix = 'foo' --- activejob/test/cases/queue_naming_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'activejob/test/cases') diff --git a/activejob/test/cases/queue_naming_test.rb b/activejob/test/cases/queue_naming_test.rb index 426af608f0..fdfd1afceb 100644 --- a/activejob/test/cases/queue_naming_test.rb +++ b/activejob/test/cases/queue_naming_test.rb @@ -20,4 +20,19 @@ class QueueNamingTest < ActiveSupport::TestCase HelloJob.queue_name = LoggingJob.queue_name = ActiveJob::Base.default_queue_name end end + + test 'should prefix the queue name' do + begin + original_queue_name_prefix = ActiveJob::Base.queue_name_prefix + original_queue_name = HelloJob.queue_name + + ActiveJob::Base.queue_name_prefix = 'aj' + HelloJob.queue_as :low + assert_equal 'aj_low', HelloJob.queue_name + ensure + ActiveJob::Base.queue_name_prefix = original_queue_name_prefix + HelloJob.queue_name = original_queue_name + end + end + end -- cgit v1.2.3