Hello, i am looking for redis queue driver, if there is not exist any where, I am interested to create a redis queue driver for cross-platform business (beanstalkd doesnot support windows) is there any interface i can follow?
|
May '14 |
7 |
2154 |
0 |
Hi, Redis is really simple to implement in your app. Just use https://github.com/nicolasff/phpredis:
$di->setShared('redis', function() {
$redis = new Redis();
$redis->pconnect(YOUR_HOST, YOUR_PORT);
return $redis;
});
Offtop: I advise you to use Phpredis with Igbinary (https://github.com/igbinary/igbinary). Just look here for Nikolaos's performance tests of serialization: https://www.niden.net/2011/11/fast-serialization-of-data-in-php-how.html.
Ali-Azmoud, I told about phpredis that is just PHP-extesion (https://github.com/nicolasff/phpredis). It is only 1 file "redis.so" (linux) or "redis.dll" (windows). Copy it to PHP "ext" folder )))
May be you asked about "Predis" (https://github.com/nrk/predis) that is PHP-wrapper for phpredis?
Sum, Ok, I understand that you want to create "yet another redis queue" :)
I think: Redis is just NoSQL db and Redis's aim is to store data in RAM. For message queue proper way is to use MQ services like beanstalkd or rabitMQ or gearman or... They will be much faster than self-maded Redis-powered queue service.
Redis is not only store in RAM. I have used redis as message queue on my project [Laravel]
Redis supports in-memory persistent storage on disk.
Redis supports the writing of its data to disk automatically in two different ways, and can store data in four structures in addition to plain string keys as memcached does. These and other differences allow Redis to solve a wider range of problems, and allow Redis to be used either as a primary database or as an auxiliary databases with other storage systems
Quote from Redis in Action Book