This is a Redis module that implements a laravel compatible queue driver for redis with the following improvements over the original Laravel 5.7 PHP-Lua driver:
- Blocking pop is now more reliable than before.
- Blocking pop now works on delayed and reserved jobs as well.
- Timer for delayed and reserved jobs is server side, with milliseconds precision. This means
you don't need to worry about syncing your php and redis servers, in case your projects are
distributed accross different servers. Moreover, this makes
retry_after
andblock_for
configurations independent of each other. - Laravel queue can now be available for other programming languages and frameworks as well. Feel free to port it to your favorite ones.
- laravel.push <queue-name> <job>
- laravel.later <queue-name>:delayed <delay-ms> <job>
- laravel.pop <queue-name> <queue-name>:delayed <queue-name>:reserved <reply-after-ms> <block-for-ms>
- laravel.delete <queue-name>:reserved <job>
- laravel.release <queue-name>:delayed <queue-name>:reserved <job> <delay-ms>
- Redis version 5.0 or higher.
- cmake > 3.1.
Running this command will create a build/liblaravelq.so
file.
mkdir build && cd build && cmake .. && make
Place this file in a directory to which your redis-server have access.
To load the module to an already running redis server run the following redis command:
module load <path/to/liblaravelq.so>
To always run redis server with the module, you can add the following to redis.conf configuration file (usually in /etc/redis directory):
loadmodule </path/to/liblaravelq.so>
After loading modules, laravel.* commands will be available.
To use this module with laravel, use halaei/lqrm composer package:
composer require halaei/lqrm
Please note that this module is not language dependent. Other languages and frameworks can hopefully benefit from this module.