Trigger the execution of all event listeners attached to a named event.

@param Proem\Signal\Event\Standard $event The event being triggered.
@param closure $callback A callback that can be used to respond to any response sent back from a listener.
183041
public function trigger(EventInterface $event, \Closure $callback = null)
    {
        if ($listeners = $this->getListeners($event->getName())) {
            foreach ($listeners as $listener) {
                if ($result = call_user_func($listener, $event)) {
                    if ($result instanceof EventInterface) {
                        // Was the queue halted early ?
                        if ($result->isQueueHaltedEarly()) {
                            return $this;
                        }

                        if ($callback !== null) {
                            call_user_func($callback, $result);
                        }

                        // Was the queue halted ?
                        if ($result->isQueueHalted()) {
                            return $this;
                        }
                    } else {
                        throw new \RuntimeException(
                            'Value returned from an Event Callback must be of type Proem\Signal\EventInterface'
                        );
                    }
                }
            }
        }

        return $this;
    }
601024
public function removeListener($event, $callback)
    {
        if (false === isset($this->listeners[$event])) {

            return;
        }

        $key = array_search($callback, $this->listeners[$event]);
        if ($key !== false) {
            unset($this->listeners[$event][$key]);

            if (0 === count($this->listeners[$event])) {
                unset($this->listeners[$event]);
            }
        }
    }
1154067
public function on($event, $callback, $first = false)
	{
		$this->register($event, $callback, $first);
	}
131211
protected function registerEvent($name, Closure $callback)
    {
        if (! isset(static::$dispatcher)) {
            $this->initEventDispatcher();
        }

        static::$dispatcher->listen($name, $callback);
    }
761575
public function subscribe(string $event, string $listener, callable $callback)
    {
        $callbackKey = $event . ' ' . $listener;
        $this->events[$event][] = $callbackKey;
        $this->subscriptions[$callbackKey] = $callback;
    }
571875
public function setCallback(callable $callback): EventObserver
    {
        $this->callback = $callback;
        $this->id = $this->getId($callback);

        return $this;
    }
1292661
private function ensureCallback($handler, $event)
    {
        if (!is_callable($handler)) {
            if (is_object($handler)) {
                if (!$handler instanceof \Closure) {
                    $handler = [$handler, $event];
                }
            }
            if (!is_callable($handler)) {
                throw new EventHandlerException("Handler is not callable for event {$event}");
            }
        }

        return $handler;
    }
456681
public static function on($event, $callback){

        if( !isset(self::$observers[ $event ]) ){
            self::$observers[ $event ] = array();
        }

        self::$observers[ $event ][] = $callback;
    }
877435
function fire(event) {
		if (typeof event !== 'string') {
			throw new Error('"event" not a string');
		}

		// any listeners registered?
		if (!hasListeners(event)) {
			return triggerObject;
		}

		// get optional arguments
		var args = Array.prototype.slice.call(arguments, 1);

		// invoke listener functions
		listeners[event].slice(0).forEach(function(fn) {
			fn.apply(global, args);
		});

		return triggerObject;
	}
494872
public function detach(string $event, $callback){
        if(isset($this->listeners[$event])){
            return $this->listeners[$event]->remove($callback);
        }
        return false;
    }
1253531
public function callback(Closure $callback)
    {
        foreach ($this->getInnerIterator() as $key => $value) {
            yield $callback($value, $key);
        }
    }
75650
function on(string $event, $callback, int $priority = 0): void
    {
        $this->getEventEmitter()->on($event, $callback, $priority);
    }
279715
public function addListener($name, callable $callback) {
        if(!array_key_exists($name, $this->registered_events)) {
            $this->registered_events[$name] = [];
        }

        $this->registered_events[$name][] = $callback;
    }
1098281
public static function resolved(Closure $callback)
    {
        static::$app->afterResolving(static::getFacadeAccessor(), function ($service) use ($callback) {
            $callback($service);
        });
    }
965550
protected function trigger($event, ...$arguments)
    {
        if (!empty($this->handlers[$event])) {
            /** @var callable $handler */
            foreach ($this->handlers[$event] as $handler) {
                call_user_func_array($handler, $arguments);
            }
        }
    }
331301
protected function addEventListener($name, $callback)
    {
        if (Str::contains($name, '*')) {
            $callback = function ($name, array $data) use ($callback) {
                return $callback($data[0]);
            };
        }

        $this->events->listen($name, $callback);
    }
283812
public static function deleteListener(String $eventName, $callback = NULL) : Bool
    {
        return Listener::delete($eventName, $callback);
    }