aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/support/integration/adapters/queue_classic.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/test/support/integration/adapters/queue_classic.rb')
-rw-r--r--activejob/test/support/integration/adapters/queue_classic.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/activejob/test/support/integration/adapters/queue_classic.rb b/activejob/test/support/integration/adapters/queue_classic.rb
new file mode 100644
index 0000000000..3b24eca5b9
--- /dev/null
+++ b/activejob/test/support/integration/adapters/queue_classic.rb
@@ -0,0 +1,21 @@
+module QC; WAIT_TIME = 0.5; end
+
+module QueueClassicJobsManager
+ def clear_jobs
+ # disabling this as it locks
+ # QC::Queue.new("active_jobs_default").delete_all
+ end
+
+ def start_workers
+ @pid = fork do
+ QC::Conn.connection = QC::Conn.connect
+ worker = QC::Worker.new(q_name: 'active_jobs_default')
+ worker.start
+ end
+ end
+
+ def stop_workers
+ Process.kill 'HUP', @pid
+ end
+end
+