router = Snowflake::getApp('router'); } /** * @param string $path * @param string|callable $callback * @throws Exception */ public function addListener(string $path, string|callable $callback): void { $this->router->addRoute('rpc/p' . $this->port . '/' . ltrim($path, '/'), $callback); } }