Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Should there be a SharedLazyListenerAggregate? #49

Open
davidwindell opened this issue Mar 15, 2017 · 3 comments
Open

Should there be a SharedLazyListenerAggregate? #49

davidwindell opened this issue Mar 15, 2017 · 3 comments

Comments

@davidwindell
Copy link
Contributor

davidwindell commented Mar 15, 2017

Is there a reason there isn't a Lazy Aggregate for attaching listeners to the Shared Event Manager?

Something like:

class SharedLazyListenerAggregate
{
    ...

    public function attachShared(SharedEventManagerInterface $manager, $priority = 1)
    {
        foreach ($this->lazyListeners as $lazyListener) {
            $this->listeners[] = $manager->attach(
                '*',
                $lazyListener->getEvent(),
                $lazyListener,
                $lazyListener->getPriority($priority)
            );
        }
    }

Ping @bakura10

@Ocramius
Copy link
Member

What would a lazy listener do?

@davidwindell
Copy link
Contributor Author

@Ocramius this would effectively be the same as the existing LazyListenerAggregate (https://github.com/zendframework/zend-eventmanager/blob/master/src/LazyListenerAggregate.php) but allow attaching to the Shared Event Manager.

@davidwindell davidwindell changed the title Should there be a LazySharedListenerAggregate? Should there be a SharedLazyListenerAggregate? Mar 15, 2017
@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-eventmanager; a new issue has been opened at laminas/laminas-eventmanager#6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants