This is an mf4php binding for Beanstalk.
Open Issues: 0
- php: >=5.3.0
- lf4php/lf4php: ~4.0
- mf4php/mf4php: ~1.1
- pda/pheanstalk: v2.1.0
- lf4php/lf4php-log4php: dev-master
This package is not auto-updated.
Last update: 2023-03-18 05:33:24 UTC
This is a Beanstalk binding for mf4php
You have to create your own long running script to reserve messages from beanstalk and forward jobs to the dispatcher.
The reason why it is not implemented in the dispatcher is it should watch several queues, which is impossible in one process. Another reason is that it is often necessary to create a lightweight long running script without any open resources (database, etc.), and it executes a CLI program to pass the message to the dispatcher.
<?php $dispatcher = new BeanstalkMessageDispatcher($pheanstalk); $queue = new DefaultQueue('queue'); /* @var $listener MessageListener */ $dispatcher->addEventListener($queue, $listener);
<?php /* @var $object Serializable */ $message = new BeanstalkMessage($object); $dispatcher->send($queue, $message); // onMessage method in $listener is called