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


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.


    [herald@aap redis]$ fifo-cli
    Type '?' for help
    FIFO:-> open localhost
    FIFO:localhost:6379 (db=0) [ / ]-> ls
    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
    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
    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


Herald van der Breggen, <>


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.