Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.08 KB

README.md

File metadata and controls

48 lines (34 loc) · 1.08 KB

NAME

TheSchwartz::Fireworq - TheSchwartz interface for Fireworq.

SYNOPSIS

package My::App;
use TheSchwartz::Fireworq;

sub work_asynchronously {
    my $client = TheSchwartz::Fireworq->new(
        server => 'http://localhost:8080',      # Fireworq host
        worker => 'http://localhost:5000/work', # Your app worker endpoint
    );
    $client->insert('My::Worker', { @_ });
}

package My::Worker;
use parent qw(TheSchwartz::Worker);

sub work {
    my ($class, $job) = @_;

    use Data::Dumper;
    warn Dumper $job->arg;
    
    $job->completed;
}

# app.psgi
package main;
use Plack::Builder;

my $app = sub { ... };
builder {
    enable 'TheSchwartz::Fireworq',
        path => '/work';
    $app;
};

AUTHOR

INA Lintaro tarao.gnn@gmail.com

SEE ALSO