License: Artistic-2.0 CPAN Version kwalitee codecov Coverage Status Ask DeepWiki GH Actions: Linux Build GH Actions: Windows Build

Dancer2-Plugin-JobScheduler

Plugin for Dancer2 web app to send and query jobs in different job schedulers

VERSION

0.007

SYNOPSIS

use Dancer2;
BEGIN {
    my %plugin_config = (
        default => 'theschwartz',
        schedulers => {
            theschwartz => {
                client => 'TheSchwartz',
                parameters => {
                    handle_uniqkey => 'acknowledge',
                    dbh_callback => 'Database::ManagedHandle->instance',
                    databases => {
                        theschwartz_db1 => {
                            prefix => q{schema_name.},
                        },
                    }
                }
            }
        }
    );
    set log => 'debug';
    set plugins => {
        JobScheduler => \%plugin_config,
    };
}
use Dancer2::Plugin::JobScheduler;

set serializer => 'JSON';

get q{/submit_job} => sub {
    my %r = submit_job(
        client => 'theschwartz',
        job => {
            task => 'task1',
            args => { name => 'My Name', age => 123 },
            opts => {},
        },
    );
    return to_json(\%r);
};

get q{/list_jobs} => sub {
    my %r = list_jobs(
        client => 'theschwartz',
        search_params => {
            task => 'task1',
        },
    );
    return to_json(\%r);
};

LICENSE

This software is copyright (c) 2026 by Mikko Koivunalho mikkoi@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Terms of the Perl programming language system itself:

a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License"

The complete licenses are in the files LICENSE-Artistic-2.0 and LICENSE-GPL-3 within this repository. If these files are missing, they can be downloaded from the following urls:

* https://www.gnu.org/licenses/
* https://www.perlfoundation.org/artistic-license-20.html