RFC: new module SQL::QueryQueue

Discussion in 'Perl Misc' started by mapeck65@gmail.com, Feb 20, 2008.

  1. Guest

    Looking for comments on the name, as well as the function of this
    module proposal. This will be my first public module submission, of a
    module I have developed and used privately for a few months. The
    intention of the module is to provide a FIFO queue for execution of
    SQL statements, providing a fault-tolerant, abstraction of the DBI.
    During times of lost database connectivity, statements will be queued
    while the SQL::QueryQueue object tries to reconnect. Once a
    connection has been reestablished, the queue will resume processing.

    SYNOPSIS:

    use SQL::QueryQueue;
    ....
    my $queue = SQL::QueryQueue->instance($db_dsn, $db_user_id,
    $db_password);
    my $sql = qq { update test set ip = '209.197.123.153' where domain
    = ?};
    $queue->submit_job($sql, 'perlmonks.org');
    ....
    # in another sub somewhere in your program...
    my $q = SQL::QueryQueue->instance();
    my $sql = qq{ select * from test where ip like '209.%' };
    my $array_ref = $q->submit_job($sql);
    foreach my $row (@$array_ref) {
    print join ', ', @$row, "\n";

    }

    The SQL::QueryQueue object inherits from Class::Singleton and depends
    on DBI. The current implementation also depends on Log::Log4perl and
    Linuga::EN::Numbers::Ordinate, though these dependencies could be
    removed.

    Any comments & suggestions are greatly appreciated.

    Michael Peck
    mpeck [at] pobox.com
     
    , Feb 20, 2008
    #1
    1. Advertising

  2. smallpond Guest

    On Feb 20, 3:19 pm, wrote:
    > Looking for comments on the name, as well as the function of this
    > module proposal. This will be my first public module submission, of a
    > module I have developed and used privately for a few months. The
    > intention of the module is to provide a FIFO queue for execution of
    > SQL statements, providing a fault-tolerant, abstraction of the DBI.
    > During times of lost database connectivity, statements will be queued
    > while the SQL::QueryQueue object tries to reconnect. Once a
    > connection has been reestablished, the queue will resume processing.
    >
    > SYNOPSIS:
    >
    > use SQL::QueryQueue;
    > ...
    > my $queue = SQL::QueryQueue->instance($db_dsn, $db_user_id,
    > $db_password);
    > my $sql = qq { update test set ip = '209.197.123.153' where domain
    > = ?};
    > $queue->submit_job($sql, 'perlmonks.org');
    > ...
    > # in another sub somewhere in your program...
    > my $q = SQL::QueryQueue->instance();
    > my $sql = qq{ select * from test where ip like '209.%' };
    > my $array_ref = $q->submit_job($sql);
    > foreach my $row (@$array_ref) {
    > print join ', ', @$row, "\n";
    >
    > }
    >
    > The SQL::QueryQueue object inherits from Class::Singleton and depends
    > on DBI. The current implementation also depends on Log::Log4perl and
    > Linuga::EN::Numbers::Ordinate, though these dependencies could be
    > removed.
    >
    > Any comments & suggestions are greatly appreciated.
    >
    > Michael Peck
    > mpeck [at] pobox.com



    Looks like a good idea, but why the limitation to a single instance?
    I've known of applications using multiple connected databases.
    --S
     
    smallpond, Feb 20, 2008
    #2
    1. Advertising

  3. Dr.Ruud Guest

    Re: new module SQL::QueryQueue

    schreef:

    > Looking for comments on the name, as well as the function of this
    > module proposal.


    See also:
    Mailing-List: contact modules-help(AT)perl.org; run by ezmlm

    --
    Affijn, Ruud

    "Gewoon is een tijger."
     
    Dr.Ruud, Feb 20, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marco Gazerro

    RFC: New module Business::GestPayCrypt

    Marco Gazerro, May 14, 2004, in forum: Perl
    Replies:
    0
    Views:
    431
    Marco Gazerro
    May 14, 2004
  2. Andy Leszczynski
    Replies:
    0
    Views:
    281
    Andy Leszczynski
    Sep 16, 2005
  3. Roy Smith

    IPv6 RFC 3542 with socket module?

    Roy Smith, Nov 22, 2005, in forum: Python
    Replies:
    1
    Views:
    289
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Nov 22, 2005
  4. Justin  Azoff

    RFC: my iterthreader module

    Justin Azoff, Jul 18, 2006, in forum: Python
    Replies:
    0
    Views:
    296
    Justin Azoff
    Jul 18, 2006
  5. Ivan Shmakov
    Replies:
    3
    Views:
    1,153
    Kari Hurtta
    Feb 13, 2012
Loading...

Share This Page