Previous topic

Next topic

This Page

Activities like processing videos, resizing images or sending emails aren’t suitable to be executed
online or in real time because it may slow the loading time of pages and severely impact the user experience.

The best solution here is to implement background jobs. The web application puts jobs
into a queue and which will be processed separately.

While you can find more sophisticated PHP extensions to address queueing in your applications like RabbitMQ;
Phalcon provides a client for Beanstalk, a job queueing backend inspired by Memcache.
It’s simple, lightweight, and completely specialized for job queueing.

Attention

Some of the returns from queue methods require that the module Yaml be installed. Please
refer to http://php.net/manual/book.yaml.php for more information. For PHP < 7, Yaml 1.3.0
is acceptable. For PHP >= 7, you will need to use Yaml >= 2.0.0.

Jobs must be removed from the queue to avoid double processing. If multiple background jobs workers are implemented,
jobs must be “reserved” so other workers don’t re-process them while other workers have them reserved: