Registers a finish filter.

Finish filters are run after the response has been sent.

@param mixed $callback Finish filter callback
@param int   $priority The higher this value, the earlier an event
listener will be triggered in the chain (defaults to 0)
336601
public function finish($callback, $priority = 0)
    {
        $app = $this;

        $this->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($callback, $app) {
            call_user_func($app['callback_resolver']->resolveCallback($callback), $event->getRequest(), $event->getResponse(), $app);
        }, $priority);
    }
107912
public function register($event, callable $listener, $priority = null)
    {
        foreach ((array) $event as $e) {
            $this->registerListener($e, $listener, $priority);
        }

        return $this;
    }
430335
public static function registrationErrors( $callback, $priority = null, $accepted_args = null ) {
		return self::filter( 'registration_errors', $callback, $priority, $accepted_args );
	}
301751
public function post(string $path, callable $callback, int $priority = 0)
    {
        return $this->route('post', $path, $callback, $priority);
    }
373101
public static function Listen($signal_type, $callback, $priority = 10)
    {
        if(!isset(self::$listeners[$signal_type]))
            self::$listeners[$signal_type] = array();

        self::$listeners[$signal_type][] = array(
            'callback' => $callback,
            'priority' => $priority
        );

        self::$listeners[$signal_type] = self::Sort(
            self::$listeners[$signal_type], 'priority'
        );
    }
907005
public static function templateInclude( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'template_include', $callback, $priority, $accepted_args );
	}
926651
public function attach($eventName, $callback, $priority = 1): void
    {
        if (!isset($this->listeners[$eventName])) {
            $this->listeners[$eventName] = [];
        }
        if (!isset($this->listeners[$eventName][$priority])) {
            $this->listeners[$eventName][$priority] = [];
        }
        $this->listeners[$eventName][$priority][] = $callback;
    }
1276414
public function addEventHandler($eventName, $eventHandlerName, $priority = 50)
    {
        $this->addHandler(self::EVENT, $eventName, $eventHandlerName, $priority);
    }
594327
public function attach($event, $callback, $priority = 0)
    {
        if (!isset($this->eventListeners[$event])) {
            $this->clearListeners($event);
        }

        $this->eventListeners[$event]->insert($callback, $priority);

        return true;
    }
113540
public function defer($runLevel, $priority = 10)
    {
        $this->deferred = true;
        $this->runLevel = $runLevel;
        $this->priority = $priority;
    }
1127789
protected function checkPriority($event, $priority)
    {
        if (!is_int($priority)) {
            $message = 'Priority for event "%s" must be an integer, but received: %s';
            $this->addProblem(sprintf($message, $event, $this->exporter->export($priority)));
            return;
        }
    }
1074098
public function once($eventName, $callBack, $priority = 100)
    {
        $eventName = $this->cleanEventName($eventName);
        $eManager  = $this;

        $wrapper = null;
        $wrapper = function () use ($eventName, $callBack, &$wrapper, $eManager) {
            $eManager->removeListener($eventName, $wrapper);
            return call_user_func_array($callBack, func_get_args());
        };

        return $this->on($eventName, $wrapper, $priority);
    }
1059495
public function listen($events, $listener, $priority = 0)
    {
        if ($priority === 0) {
            $this->events->on($events, $listener);
            return;
        }

        if ($priority > 5) {
            $this->events->onBefore($events, $listener);
            return;
        }

        $this->events->onAfter($events, $listener);

    }
1100625
public function monitor(callable $callback): void
    {
        swoole_event_add($this->resource, function () use ($callback) {
            $events = inotify_read($this->resource);
            call_user_func_array($callback, [$events]);
        });

        swoole_event_wait();
    }
303112
public static function init( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'init', $callback, $priority, $accepted_args );
	}
75650
function on(string $event, $callback, int $priority = 0): void
    {
        $this->getEventEmitter()->on($event, $callback, $priority);
    }
1088050
public static function userRegister( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'user_register', $callback, $priority, $accepted_args );
	}