From 68554b049f9bb60c0fc0e9e447b01f52d4bf8404 Mon Sep 17 00:00:00 2001 From: Stuart Rowlands Date: Tue, 15 Jun 2021 11:20:17 +1200 Subject: [PATCH] Added simple threaded worker for processing quant queue. --- drush.services.yml | 5 +++++ src/Commands/QuantDrushCommands.php | 32 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 drush.services.yml create mode 100644 src/Commands/QuantDrushCommands.php diff --git a/drush.services.yml b/drush.services.yml new file mode 100644 index 00000000..c81c7bb5 --- /dev/null +++ b/drush.services.yml @@ -0,0 +1,5 @@ +services: + quantcdn.commands: + class: \Drupal\quant\Commands\QuantDrushCommands + tags: + - { name: drush.command } diff --git a/src/Commands/QuantDrushCommands.php b/src/Commands/QuantDrushCommands.php new file mode 100644 index 00000000..439ebeae --- /dev/null +++ b/src/Commands/QuantDrushCommands.php @@ -0,0 +1,32 @@ + 5]) { + $this->output()->writeln("Forking seed worker."); + for ($i=0; $i<$options['threads']; $i++) { + $cmd = 'drush queue:run quant_seed_worker'; + $process = proc_open($cmd, array(), $pipes, NULL, NULL, array('bypass_shell' => TRUE)); + } + } + +} +