NAME

Forks::Queue::SQLite - SQLite-based implementation of Forks::Queue

VERSION

0.15

SYNOPSIS

my $q = Forks::Queue->new( impl => 'SQLite', db_file => "queue-file" );
$q->put( "job1" );
$q->put( { name => "job2", task => "do something", data => [42,19] } );
...
$q->end;
for my $w (1 .. $num_workers) {
    if (fork() == 0) {
        my $task;
        while (defined($task = $q->get)) {
            ... perform task in child ...
        }
        exit;
    }
}

DESCRIPTION

SQLite-based implementation of Forks::Queue. It requires the sqlite3 libraries and the DBD::SQLite Perl module.

METHODS

See Forks::Queue for an overview of the methods supported by this Forks::Queue implementation.

new

$queue = Forks::Queue::SQLite->new( %opts )

$queue = Forks::Queue->new( impl => 'SQLite', %opts )

The Forks::Queue::SQLite constructor recognized the following configuration options.

  • db_file

    The name of the file to use to store queue data and metadata. If omitted, a temporary filename is chosen.

  • style

  • limit

  • on_limit

  • join

  • persist

    See "new" in Forks::Queue for descriptions of these options.

LICENSE AND COPYRIGHT

Copyright (c) 2017-2019, Marty O'Brien.

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

See http://dev.perl.org/licenses/ for more information.