protected function setSwooleServerListeners()
    {
        foreach ($this->events as $event) {
            $listener = Str::camel("on_$event");
            $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {
                $this->container->event->trigger("swoole.$event", func_get_args());
            };

            $this->container->make(Server::class)->on($event, $callback);
        }
    }
protected function setSwooleServerListeners()
    {
        foreach ($this->events as $event) {
            $listener = Str::camel("on_$event");
            $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {
                $this->container->event->trigger("swoole.$event", func_get_args());
            };

            $this->container->make(Server::class)->on($event, $callback);
        }
    }
protected function setSwooleServerListeners ( ) { foreach ( $ this -> events as $ event ) { $ listener = Str :: camel ( "on_$event" ) ; $ callback = method_exists ( $ this , $ listener ) ? [ $ this , $ listener ] : function ( ) use ( $ event ) { $ this -> container -> event -> trigger ( "swoole.$event" , func_get_args ( ) ) ; } ; $ this -> container -> make ( Server :: class ) -> on ( $ event , $ callback ) ; } }
Set swoole server listeners.
Set swoole server listeners .