NAME

Queue::Q::ReliableFIFO::CLI - Command line interface to queues in Redis

DESCRIPTION

A command line interface can be started by

perl -MQueue::Q::ReliableFIFO::CLI \
    -e 'Queue::Q::ReliableFIFO::CLI->new->run()'

You can put that in a file e.g. called 'fifo-cli' and put that file in your PATH.

The last state of the cli session is saved in $ENV{HOME}/.reliablefifo (as JSON). When restarting the cli, the previous context will be reloaded, i.e. connection, directory and history (unless the parameter ignore_config_file is passed to run()).

The command a in unix style, like "ls", "cd", "rm" and "mv". Press "?" to get a list of available commands. A directory structure is emulated in which the highest level is the queue name and the second level is a type of queue, i.e. queue with busy items, queue with failed items and main queue with waiting items.

The "mv" and "rm" resp. move and remove items. The commands accept an extra parameter to limit the number of items they handle.

Example:

[herald@aap redis]$ fifo-cli
Type '?' for help
FIFO:-> open localhost
FIFO:localhost:6379 (db=0) [ / ]-> ls
mytest
FIFO:localhost:6379 (db=0) [ / ]-> cd mytest
FIFO:localhost:6379 (db=0) [ /mytest ]-> ls
   main: 4054 items
   busy: 0 items
 failed: 2 items
FIFO:localhost:6379 (db=0) [ /mytest ]-> ls failed
{"b":{"k":9,"x":783348.75271916,"s":"bgky"},"t":1352319296}
{"b":{"k":10,"x":574480.695396417,"s":"irzd"},"t":1352319296}
FIFO:localhost:6379 (db=0) [ /mytest ]-> mv failed main  
2 items moved
FIFO:localhost:6379 (db=0) [ /mytest ]-> ls
   main: 4056 items
   busy: 0 items
 failed: 0 items
FIFO:localhost:6379 (db=0) [ /mytest ]-> cd main
FIFO:localhost:6379 (db=0) [ /mytest/main ]-> ls
{"b":{"k":11,"x":664047.321063155,"s":"ptkx"},"t":1352319296}
{"b":{"k":12,"x":502226.272384469,"s":"yrqb"},"t":1352319296}
...
FIFO:localhost:6379 (db=0) [ /mytest/main ]-> mv . ../failed 1
1 items moved
FIFO:localhost:6379 (db=0) [ /mytest/main ]-> cd ..
FIFO:localhost:6379 (db=0) [ /mytest ]-> ls
   main: 4055 items
   busy: 0 items
 failed: 1 items

AUTHOR

Herald van der Breggen, <herald.vanderbreggen@booking.com>

COPYRIGHT AND LICENSE

Copyright (C) 2012 by Herald van der Breggen

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.