-
-
08 Mar 2014 13:32:02 UTC
- Distribution: Mojolicious-Plugin-Resque
- Module version: 0.02
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (279 / 6 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (11.53KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Mojolicious::Plugin::Resque - Mojolicious helper for sending jobs to a Resque queue.
VERSION
version 0.02
SYNOPSIS
Provides a helper to ease the use of Resque in your Mojolicious application.
# Lite app with options plugin 'resque' => { server => 'localhost:6379', helper => 'resque' }; # Same as plugin 'resque'; # Full app at startup() sub startup { my $self = shift; $self->plugin( resque => { server => 'localhost:6379', helper => 'resque' }); }
CONFIGURATION OPTIONS
You can pass any argument accepted by Resque constructor plus:
helper
Name for the helper method created by this plugin. By default it will be 'resque'.
HELPERS
resque
When used without arguments this helper will return an instance of resque ready to use. If you pass arguments those will be passed to "push" in Resque as this is the most common method to be used from your app in runtime.
So, this two examples do just the same:
sub my_action { my $self = shift; # ping Redis server $self->resque->push( my_queue => { class => 'My::Task', args => [ 'Bite my shiny metal ass!' ] }); $self->resque( my_queue => { class => 'My::Task', args => [ 'Bite my shiny metal ass!' ] }); }
AUTHOR
Diego Kuperman <diego@freekeylabs.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Diego Kuperman.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Mojolicious::Plugin::Resque, copy and paste the appropriate command in to your terminal.
cpanm Mojolicious::Plugin::Resque
perl -MCPAN -e shell install Mojolicious::Plugin::Resque
For more information on module installation, please visit the detailed CPAN module installation guide.