Skip to content

Commit

Permalink
chore(swoole): php backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mcharytoniuk committed Jan 12, 2024
1 parent 1d75ce9 commit f2d829a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Backends/Swoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,18 @@ public function process() : array

while (($queueItem = array_shift($this->queue))) {
$workerProcess = new Process(
callback: function (Process $worker) use ($queueItem) {
function (Process $worker) use ($queueItem) {
$worker->exportSocket()->send(igbinary_serialize($queueItem()));
},
enable_coroutine: true,
pipe_type: 1,
redirect_stdin_and_stdout: false,
// redirect_stdin_and_stdout
false,
// pipe_type
SOCK_STREAM,
// enable_coroutine
true,
);

$workerProcess->setAffinity([
$currentCpu,
]);
$workerProcess->setAffinity([$currentCpu]);
$workerProcess->setBlocking(false);
$workerProcess->start();

Expand Down

0 comments on commit f2d829a

Please sign in to comment.