Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2
Lightweight Event dispatcher library compatible with PSR container
License
NotificationsYou must be signed in to change notification settings
antidot-framework/antidot-event-dispatcher
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Psr 14 Event dispatcher implementation.
Usingcomposer
composer require antidot-fw/event-dispatcher
it install the library automatically
<?php/** @var \Psr\Container\ContainerInterface $container */$container->set('config', ['app-events' => ['event-listeners' => [// SomeEvent::class => ['some.event' => [ SomeEventListener::class, SomeEventOtherListener::class, ] ] ]]);
<?phpuseAntidot\Event\Container\EventDispatcherFactory;usePsr\EventDispatcher\EventDispatcherInterface;$factory =newEventDispatcherFactory();$eventDispatcher =$factory->__invoke($container);$container->set(EventDispatcherInterface::class,$eventDispatcher);
composer require react/event-loop
<?phpuseAntidot\Event\Container\AsyncEventDispatcherFactory;usePsr\EventDispatcher\EventDispatcherInterface;$factory =newAsyncEventDispatcherFactory();$eventDispatcher =$factory->__invoke($container);$container->set(EventDispatcherInterface::class,$eventDispatcher);
<?phpusePsr\EventDispatcher\EventDispatcherInterface;/** @var \Psr\Container\ContainerInterface $container */$eventDispatcher =$container->get(EventDispatcherInterface::class);$eventDispatcher->dispatch(SomeEvent::occur());
<?phpusePsr\EventDispatcher\EventDispatcherInterface;useReact\EventLoop\Loop;/** @var \Psr\Container\ContainerInterface $container */$eventDispatcher =$container->get(EventDispatcherInterface::class);$eventDispatcher->dispatch(SomeEvent::occur());Loop::run()
About
Lightweight Event dispatcher library compatible with PSR container
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.



