The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

NetSDS::App::QueueProcessor - queue processing server framework

SYNOPSIS

        -----------------------------
        # Configuration file

        # Queue server IP and port
        queue_server = "127.0.0.1:22201"

        # Pulling queue name
        queue_name = "myq"

        # Processing bandwidth (messages per second)
        bandwidth = 2

        # Timeout on idle loops
        idle_timeout = 3
        -----------------------------

        QProc->run(conf_file => './qproc.conf');

        1;

        package QProc;

        use Data::Dumper;
        use base 'NetSDS::App::QueueProcessor';

        # Message processing logic
        sub process {

                my ( $self, $msg ) = @_;

                # Just dump message structure
                print Dumper($msg);

        }

        1;

DESCRIPTION

NetSDS::App::QueueProcessor module implements framework for applications processing messages arriving from MemcacheQ queue server.

CLASS API

new([...]) - class constructor
initialize() - application initialization

Internal method implementing common startup actions.

main_loop() - main processing loop

Internal method for application logic.

process() - main JSON-RPC iteration

This is internal method that implements JSON-RPC call processing.

EXAMPLES

See samples/app_qproc.pl appliction.

SEE ALSO

NetSDS::Queue

NetSDS::App

TODO

None

AUTHOR

Michael Bochkaryov <misha@rattler.kiev.ua>

LICENSE

Copyright (C) 2008-2009 Michael Bochkaryov

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA