Download the PHP package zhem4ag/event-snoozer without Composer
On this page you can find all versions of the php package zhem4ag/event-snoozer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zhem4ag/event-snoozer
More information about zhem4ag/event-snoozer
Files in zhem4ag/event-snoozer
Package event-snoozer
Short Description Snooze your events for later dispatch.
License MIT
Informations about the package event-snoozer
EventSnoozer
=
Current library allows You to store events and dispatch them later.
Usage
-
Implement EventStorageInterface or use MemoryEventStorage. I suggest to use database or cache for storing events. For example, I'll use MemoryEventStorage.
It will store snoozed events until script stop running. -
Create event class that you want to save. You could extend EventDispatcher Event class, but if you want to specify additional data and/or priority, extend RealEvent class.
-
Instantiate EventSnoozer class and use it for saving events.
- Use EventSnoozer for dispatching saved events.
MemoryEventStorage would select events ordered by priority and runtime.
I suggest to use symfony/console for creating console commands and run it in background by cronjob.