Invoke Given Listener

@param callable      $listener
@param DataCollector $dataCollector Clone/Copy of Collector Instance

@return null|array|\Traversable null mean skip result
770610
function invokeListener($listener, DataCollector $dataCollector)
    {
        $result = parent::invokeListener($listener, $dataCollector);
        $result = call_user_func($this->callable, $result, $this);
        return $result;
    }
422556
public function createCollector(
        $type,
        $namespace,
        $requestNumber,
        $timeInterval,
        $configuratorCallable = null
    ) {
        $className = $this->getCollectorClassName($type);

        $collector = new $className(
            $this->getKey() . ':' . $namespace,
            $requestNumber,
            $timeInterval
        );

        if (!($collector instanceof CollectorInterface)) {
            throw new \Exception('Collector must inherit CollectorInterface');
        }

        // configure
        if(is_callable($configuratorCallable)) {
            call_user_func($configuratorCallable, $collector, $this);
        }

        return $collector;

    }
1184439
private function runInterceptors(
        AnnotationCollection $annotations,
        InterceptionInterface $interception,
        Closure $callback
    ) {
        foreach ($annotations as $annotation) {
            foreach ($this->interceptors as $interceptor) {
                if (!$interceptor->canInterceptAnnotation($annotation)) {
                    continue;
                }

                $result = $callback($interceptor, $annotation, $interception);
                $this->resultCollector->collect($result);

                if ($result instanceof ContentAwareResultInterface && $result->hasContent()) {
                    return $result->getContent();
                }
            }
        }

        return null;
    }
1159049
public function createClassListener($listener)
    {
        return function() use ($listener)
        {
            $callable = $this->createClassCallable($listener);

            // We will make a callable of the listener instance and a method that should
            // be called on that instance, then we will pass in the arguments that we
            // received in this method into this listener class instance's methods.
            $data = func_get_args();

            return call_user_func_array($callable, $data);
        };
    }
977903
public function createClassListener($listener)
	{
		$container = $this->container;

		return function() use ($listener, $container)
		{
			// If the listener has an @ sign, we will assume it is being used to delimit
			// the class name from the handle method name. This allows for handlers
			// to run multiple handler methods in a single class for convenience.
			$segments = explode('@', $listener);

			$method = count($segments) == 2 ? $segments[1] : 'handle';

			$callable = array($container->make($segments[0]), $method);

			// We will make a callable of the listener instance and a method that should
			// be called on that instance, then we will pass in the arguments that we
			// received in this method into this listener class instance's methods.
			$data = func_get_args();

			return call_user_func_array($callable, $data);
		};
	}
1010745
public function createClassListener($listener)
    {
        $container = $this->container;

        return function () use ($listener, $container)
        {
            return call_user_func_array(
                $this->createClassCallable($listener, $container),
                func_get_args()
            );
        };
    }
477198
public function executeAndRedirect(Listener $listener)
    {
        $this->publisher->connected() && $this->publisher->execute();

        return $listener->publishingHasSucceed();
    }
227470
public function setEventListener($listener)
	{
		$this->ensureEventListeners();
		
		$this->_eventListeners[Ioc::resolveClassName($listener)] =  $listener;
		
		return $this;
	}
787194
protected function removeListener(callable $listener) : interfaces\Emitter
    {
        foreach ($this->listeners as $event => $priorityMap) {
            foreach ($priorityMap as $priority => $listeners) {
                if (false !== $key = array_search($listener, $listeners, true)) {
                    unset($this->listeners[$event][$priority][$key], $this->chain[$event]);
                }
            }
        }

        return $this;
    }
771536
public function addListener(DBListener $listener, $name = null)
	{
		if($name !== null)
			$this->listeners->offsetSet($name, $listener);
		else
			$this->listeners->append($listener);
	}
1307568
public function create(RuleListener $listener)
    {
        $rule = new Rule();
        $form = $this->presenter->form($rule);

        return $listener->showCreateForm(compact('rule', 'form'));
    }
1232790
protected function callListenerBindings(Listener $listener, Event $event)
    {
        $binding = $listener->determineEventBinding($event);

        if ($listener->hasBinding($binding)) {
            foreach ($listener->getBindings($binding) as $callback) {
                $resource = $event->getResource();

                call_user_func($callback, $resource, $resource->getPath());
            }
        }

        // If a listener has a binding for anything we'll also spin through
        // them and call each of them.
        if ($listener->hasBinding('*')) {
            foreach ($listener->getBindings('*') as $callback) {
                $resource = $event->getResource();

                call_user_func($callback, $event, $resource, $resource->getPath());
            }
        }
    }
299221
public function addListener(ListenerInterface $listener)
    {
        if (!in_array($listener, $this->collection_listeners, true)) {
            $this->collection_listeners[] = $listener;
        }
    }
113134
function detachListener(iListener $listener)
    {
        $this->_listenerQueue()->del($listener);

        if (in_array($listener, $this->_c_listeners)) {
            foreach ($this->_c_listeners as $k => $l) {
                if ($l === $listener) {
                    unset($this->_c_listeners[$k]);
                    break;
                }
            }
        }

        return $this;
    }
204786
public function getListener($listener)
    {
        if (isset($this->listeners[$listener])) {
            return $this->listeners[$listener];
        }
        return false;
    }
451556
public function listen($event, $listener){
        if (!$this->emitter){
            return $this;
        }
        $this->emitter->listen($event, $listener);
        return $this;
    }
1244810
public function createClassListener($listener)
    {
        return function ($event, $payload) use ($listener) {
            return call_user_func_array($this->createClassCallable($listener), $payload);
        };
    }