From 7316d2791de7e0cf97235fd108bba4132eec80c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 1 Sep 2020 15:06:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/Process/Process.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/Process/Process.php b/system/Process/Process.php index 6519fdf1..07599b53 100644 --- a/system/Process/Process.php +++ b/system/Process/Process.php @@ -6,6 +6,9 @@ namespace Snowflake\Process; use Snowflake\Abstracts\Component; use Snowflake\Application; +use Snowflake\Exception\ComponentException; +use Swoole\Coroutine\Socket; +use Swoole\Process\Pool; /** * Class Process @@ -37,6 +40,17 @@ abstract class Process extends Component abstract public function onHandler(\Swoole\Process $process); + /** + * @param $workerId + * @return Socket + * @throws ComponentException + */ + protected function exportSocket($workerId) + { + return $this->application->get(Pool::class)->getProcess(1)->exportSocket(); + } + + /** */ protected function start()