From 697590bc544c83bb221670e8e796b92aae24413a Mon Sep 17 00:00:00 2001 From: Mateusz Charytoniuk Date: Sat, 23 Mar 2024 17:03:15 +0100 Subject: [PATCH] fix(swoole): setAffinity does not exist on some versions of Swoole --- src/Backends/Swoole.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Backends/Swoole.php b/src/Backends/Swoole.php index 34eb894b8..6eb268c8d 100644 --- a/src/Backends/Swoole.php +++ b/src/Backends/Swoole.php @@ -98,7 +98,10 @@ function (Process $worker) use ($maxMessageLength, $queueItem) { true, ); - $workerProcess->setAffinity([$currentCpu]); + if (method_exists($workerProcess, 'setAffinity')) { + $workerProcess->setAffinity([$currentCpu]); + } + $workerProcess->setBlocking(false); $workerProcess->start();