NAME
Mojolicious::Plugin::RenderSteps - ASync controllers without the boilerplate
SYNOPSIS
# Mojolicious::Lite
plugin 'RenderSteps';
get '/foo' => sub {
my $self->shift;
$self->render_steps(sub {
my $delay=shift;
$self->ua->get('reddit.com/',$delay->begin);
}, sub {
my $delay=shift;
$self->stash(res=>shift);
});
};
DESCRIPTION § Mojolicious::Plugin::RenderSteps lets you run async callbacks easily. When you call render_steps, it will automatically call render_later, and create a Mojo::IOLoop::Delay object, pass it your steps, and set up automatic rendering and error handling. This makes async actions behave like sync ones.
METHODS
Mojolicious::Plugin::RenderSteps inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
$plugin->register(Mojolicious->new);
Creates the render_steps helper.
SEE ALSO
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
LICENSE
This module is licensed under the same terms as Perl itself.
COPYRIGHT
Copyright 2014 Marcus Ramberg