This commit is contained in:
2020-09-01 15:06:52 +08:00
parent 3d33193716
commit 7316d2791d
+14
View File
@@ -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()