Register the listeners for the subscriber.

@param  Dispatcher $events
760384
public function subscribe($events)
    {
        $events->listen(
            [
                ApiEvent::class,
            ],
            static::class . '@handleApiEvent'
        );
        $events->listen(
            [
                ServiceModifiedEvent::class,
                ServiceDeletedEvent::class,
            ],
            static::class . '@handleServiceChangeEvent'
        );
        if (config('df.db.query_log_enabled')) {
            $events->listen(
                [
                    QueryExecuted::class,
                ],
                static::class . '@handleQueryExecutedEvent'
            );
        }
    }
830402
public function listen($events, $listener)
    {
        foreach ((array) $events as $event) {
            if (Str::contains($event, '*')) {
                $this->setupWildcardListen($event, $listener);
            } else {
                $this->listeners[$event][] = $this->makeListener($listener);
            }
        }
    }
190132
public function add_listener($event) {
		if (strpos('::', $event) === false) {
			$classname = get_called_class();
			$method = $event;
		} else {
			list($classname, $method) = explode('::', $event);
		}
		$event_name = strtolower(str_replace('\\', '_', $classname . '_' . $method));

		$dispatcher = \Skeleton\Event\Dispatcher::get();
		$dispatcher->add_listener($event_name, [ '\\Event\\' . $classname, $method ]);
	}
184033
public function subscribe(Dispatcher $events)
    {
        $events->listen(
            DiskUsageHealthy::class,
            static::class.'@whenDiskUsageHealthy'
        );

        $events->listen(
            DiskUsageAlarm::class,
            static::class.'@whenDiskUsageAlarm'
        );

        $events->listen(
            HttpPingUp::class,
            static::class.'@whenHttpPingUp'
        );

        $events->listen(
            HttpPingDown::class,
            static::class.'@whenHttpPingDown'
        );

        $events->listen(
            SSLCertificateValid::class,
            static::class.'@whenSSLCertificateValid'
        );

        $events->listen(
            SSLCertificateInvalid::class,
            static::class.'@whenSSLCertificateInvalid'
        );

        $events->listen(
            SSLCertificateExpiring::class,
            static::class.'@whenSSLCertificateExpiring'
        );
    }
689805
private function addSubscribers(array $eventSubscribers)
    {
        foreach ($eventSubscribers as $eventSubscriber) {
            if (is_string($eventSubscriber)) {
                $eventSubscriber = new $eventSubscriber();
            } elseif (is_callable($eventSubscriber)) {
                $eventSubscriber = call_user_func($eventSubscriber, $this->dispatcher);
            }

            $this->dispatcher->addSubscriber($eventSubscriber);
        }

        return $this;
    }
369679
protected function registerServerEvents(array $events): void
    {
        $eventInfo = [];

        // register event to swoole
        foreach ($events as $name => $cb) {
            // is a Closure callback, add by self::onSwoole()
            if (\is_object($cb) && \method_exists($cb, '__invoke')) {
                $eventInfo[] = [$name, \get_class($cb)];
                $this->server->on($name, $cb);
                continue;
            }

            if (\is_string($cb)) {
                if (\is_int($name)) {
                    $name = $cb;
                }

                $method = SwooleEvent::getHandler($cb);
                if ($method && \method_exists($this, $method)) {
                    $eventInfo[] = [$name, static::class . "->$method"];
                    $this->server->on($name, [$this, $method]);
                } elseif (\function_exists($cb)) {
                    $eventInfo[] = [$name, $cb];
                    $this->server->on($name, $cb);
                }
            }
        }

        Show::table($eventInfo, 'Registered events to the server', [
            'showBorder' => 0,
            'columns'    => ['event name', 'swoole event handler']
        ]);
    }
1206853
private function addListeners(array $events)
    {
        foreach ($events as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                if (is_array($listener) && count($listener) === 2 && is_int($listener[1])) {
                    list($listener, $priority) = $listener;
                } else {
                    $priority = 0;
                }
                $this->dispatcher->addListener($eventName, $listener, $priority);
            }
        }

        return $this;
    }
869785
public function setListeners(array $listeners)
    {
        $this->listeners = [];

        foreach ($listeners as $name => $listener) {
            $this->addListener($name, $listener);
        }
    }
1374475
private function registerEvents()
    {
        foreach ($this->getSetting('events', []) as $event => $listeners) {
            foreach ($listeners as $listener) {
                Event::bind($event, $listener);
            }
        }
    }
1259105
protected function makeEventAndListeners($event, $listeners)
    {
        if (! Str::contains($event, '\\')) {
            return;
        }

        $this->callSilent('make:event', ['name' => $event]);

        $this->makeListeners($event, $listeners);
    }
1276343
public function subscribe(Dispatcher $events)
    {
        $events->listen(LoginEvent::class, UserAuthListener::class . '@onUserLogin');
        $events->listen(LogoutEvent::class, UserAuthListener::class . '@onUserLogout');
    }
662263
public function subscribe(Dispatcher $events)
    {
        $events->listen(PrepareUnserializedSettings::class, [$this, 'addUploadMethods']);
        $events->listen(PrepareApiAttributes::class, [$this, 'prepareApiAttributes']);
    }
639465
public function addListener(string $eventName, $listener) : void
    {
        $this->dispatcher->addListener($eventName, $listener);
    }
552547
public function attach(EventManagerInterface $events)
    {
        $this->listeners[] = $events->attach(
            ComposerEvent::EVENT_HEADERS_POST,
            array($this, 'injectOverrideHeaders'),
            -100 // The priority needs to be lower than the other plugins
        );
    }
403877
protected function registerListeners()
    {
        Event::listen(RouteMatched::class, BlockLoad::class);
        Event::listen(GzeroRouteMatched::class, BlockLoad::class);
        Event::listen('block.*', BlockCacheClear::class);
    }
1315792
public function bind(EventDispatcherInterface $dispatcher, $eventName)
    {
        if (isset($this->events[$eventName])) {
            return;
        }

        $dispatcher->addListener($eventName, $this->getListener(), $this->priority);
        $this->events[$eventName] = true;
    }
311104
public function handle(Dispatcher $events)
    {
        $model = $this->argument('model');
        $this->likeType = $this->argument('type');
        $this->service = app(LikeableServiceContract::class);

        if (empty($model)) {
            $this->recountLikesOfAllModelTypes();
        } else {
            $this->recountLikesOfModelType($model);
        }
    }