modify
This commit is contained in:
@@ -153,28 +153,11 @@ class BASEServerListener
|
||||
$customProcess = new $customProcess($this->server);
|
||||
}
|
||||
/** @var Process $process */
|
||||
$process = $this->server->addProcess(
|
||||
new Process(
|
||||
function (Process $soloProcess) use ($customProcess) {
|
||||
$this->server->addProcess(new Process(function (Process $soloProcess) use ($customProcess) {
|
||||
$soloProcess->name($customProcess->getProcessName($soloProcess));
|
||||
/** @var \Swoole\Coroutine\Socket $export */
|
||||
$export = $soloProcess->exportSocket();
|
||||
loop(function () use ($export, $customProcess) {
|
||||
$read = $export->recv();
|
||||
if (!empty($read)) {
|
||||
$customProcess->receive($read);
|
||||
}
|
||||
});
|
||||
$customProcess->onHandler($soloProcess);
|
||||
},
|
||||
$redirect_stdin_and_stdout,
|
||||
$pipe_type,
|
||||
$enable_coroutine
|
||||
)
|
||||
);
|
||||
/** @var \Swoole\Coroutine\Socket $socket */
|
||||
$socket = $process->exportSocket();
|
||||
$socket->send("");
|
||||
$redirect_stdin_and_stdout, $pipe_type, $enable_coroutine));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,10 +28,5 @@ interface CustomProcess
|
||||
public function onHandler(Process $process): void;
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $data
|
||||
*/
|
||||
public function receive(mixed $data): void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,15 +31,6 @@ class RelationshipSystemProcess implements CustomProcess
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $data
|
||||
*/
|
||||
public function receive(mixed $data): void
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user