Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diegok/mojolicious-resque
Mojolicious plugin for sending jobs to a Resque queue
https://github.com/diegok/mojolicious-resque
Last synced: about 2 months ago
JSON representation
Mojolicious plugin for sending jobs to a Resque queue
- Host: GitHub
- URL: https://github.com/diegok/mojolicious-resque
- Owner: diegok
- Created: 2012-09-15T12:33:56.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-10-29T16:30:26.000Z (about 5 years ago)
- Last Synced: 2024-04-14T16:03:21.032Z (9 months ago)
- Language: Perl
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.pod
- Changelog: Changes
Awesome Lists containing this project
README
=pod
=head1 NAME
Mojolicious::Plugin::Resque - Mojolicious helper for sending jobs to a Resque queue.
=head1 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'
});
}
=head1 CONFIGURATION OPTIONS
You can pass any argument accepted by L constructor plus:
=head2 helper
Name for the helper method created by this plugin. By default it will be 'resque'.
=head1 HELPERS
=head2 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 L 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!' ]
});
}
=head1 AUTHOR
Diego Kuperman
=head1 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.
=cut