Redis queue design choices

In a previous post I wrote about simple job queue in Redis. In this post I like to write a bit about the design choices. I think these choices illustrate a point about design. Job handle The job handle in the code is create by the client (with help from the Redis server). This job handle is passed to the queue in Redis and picked up on the other side by the worker....

September 6, 2013

Simple queue in Redis with Perl

Sometimes you need to have a asynchronous worker written in Perl. The small script here takes a job from the queue and executes the code. It only takes a few lines of Perl. use Redis; my $redis = Redis->new(encoding => undef); my $queue_name = 'q'; my $timeout = 10; for (;;) { my ($queue, $job_id) = $redis->blpop(join(':', $queue_name, 'queue'), $timeout); if ($job_id) { my %data = $redis->hgetall($job_id); # do something with data....

September 2, 2013