Download the PHP package vivait/delayed-event-bundle without Composer
On this page you can find all versions of the php package vivait/delayed-event-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vivait/delayed-event-bundle
More information about vivait/delayed-event-bundle
Files in vivait/delayed-event-bundle
Package delayed-event-bundle
Short Description A bundle that delays events for a configurable time period (i.e. 24 hours)
License MIT
Informations about the package delayed-event-bundle
Delayed Event Bundle
Triggers a Symfony event an arbitrary period after the original event
Configure the service
Beanstalkd queue transport
This relies on pheanstalk
being installed and setup in your config. You can pass extra information to the beanstalk queue using the configuration
parameter:
Be aware TTR is the time a process can run before it effectively retries, if it's too short there is a realistic possibility that a job will be processed twice.
Creating a delayed event
Instead of tagging the event with a kernel tag, tag the event with a delayed_event
tag and provide a delay:
By default, any integer will be treated as seconds. The bundle will use PHP's textual datetime parsing to parse a textual datetime string in to seconds like in the example above.
Transformers
If you're delaying an event, rather than store the exact state of an entity at the time of the event, you'll probably want to receive the latest version of the entity. The bundle allows the usage of transformers, which are ran before each property of an event is serialized. By default, the bundle has an entity transformer enabled, which will detect any entities in an event and store a reference to an entity. This means that when the entity is unserialized for the delayed event, a fresh entity is loaded from the database.
You can enable/disable transformers on a global level:
You can also enable/disable them when tagging an event listener:
Note: The enabled
part is optional, and in the example above has been left out for brevity.
You can create custom transformers by implementing the TransformerInterface
interface, like so:
You must then tag the custom transformer:
All versions of delayed-event-bundle with dependencies
ext-json Version *
symfony/framework-bundle Version ^4.4|^5.4
symfony/dependency-injection Version ^4.4|^5.4
symfony/config Version ^4.4|^5.4
symfony/console Version ^4.4|^5.4
symfony/process Version ^4.4|^5.4
symfony/event-dispatcher Version ^4.4|^5.4
wrep/daemonizable-command Version ~3.1
symfony/monolog-bundle Version ~3.0
leezy/pheanstalk-bundle Version 4.x-dev@dev
symfony/uid Version ^5.2|^6.0
vivait/backoff Version ^1.1