Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should there be a SharedLazyListenerAggregate? #6

Open
weierophinney opened this issue Dec 31, 2019 · 2 comments
Open

Should there be a SharedLazyListenerAggregate? #6

weierophinney opened this issue Dec 31, 2019 · 2 comments

Comments

@weierophinney
Copy link
Member

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


Originally posted by @davidwindell at zendframework/zend-eventmanager#49

@weierophinney
Copy link
Member Author

What would a lazy listener do?


Originally posted by @Ocramius at zendframework/zend-eventmanager#49 (comment)

@weierophinney
Copy link
Member 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.


Originally posted by @davidwindell at zendframework/zend-eventmanager#49 (comment)

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

No branches or pull requests

1 participant