Mojolicious::Plugin::RenderSteps - ASync controllers without the boilerplate
# 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); }); };
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.
render_steps also automatically calls wait if the ioloop isn't running, so steps will function under PSGI, for instance.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
This module is licensed under the same terms as Perl itself.
Copyright 2014 Marcus Ramberg
To install Mojolicious::Plugin::RenderSteps, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::RenderSteps
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::RenderSteps
For more information on module installation, please visit the detailed CPAN module installation guide.