Hi walkor,请问webman自定义进程里面如何拿到work实例呢?
class Websocket {
public function onWorkerStart($worker) { } public function onMessage(TcpConnection $connection, $data) { //这里如何拿到work实例呢? echo "{$data}\n"; }
}
这有难度么?😂
class Websocket { protected $worker; public function onWorkerStart($worker) { $this->worker = $worker; } public function onMessage(TcpConnection $connection, $data) { $worker = $this->worker; } }
6
哈哈,😂
这有难度么?😂
6
哈哈,😂