Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcusramberg/mojolicious-plugin-promiseactions
https://github.com/marcusramberg/mojolicious-plugin-promiseactions
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcusramberg/mojolicious-plugin-promiseactions
- Owner: marcusramberg
- Created: 2018-05-12T16:04:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-29T15:13:18.000Z (about 4 years ago)
- Last Synced: 2024-04-09T22:04:21.357Z (9 months ago)
- Language: Perl
- Size: 20.5 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# NAME
Mojolicious::Plugin::PromiseActions - Automatic async and error handling for Promises
# SYNOPSIS
plugin 'PromiseActions';
get '/' => sub {
my $c=shift;
app->ua->get_p('ifconfig.me/all.json')->then(sub {
$c->render(text=>shift->res->json('/ip_addr'));
});
};# METHODS
## register
Sets up a around\_dispatch hook to disable automatic rendering and
add a default catch callback to render an exception page when
actions return a [Mojo::Promise](https://metacpan.org/pod/Mojo::Promise)# COPYRIGHT AND LICENSE
Copyright (C) 2019, Marcus Ramberg.
This program is free software, you can redistribute it and/or modify it under
the terms of the Artistic License version 2.0.# AUTHORS
Joel Berger, `[email protected]`
Marcus Ramberg, `[email protected]`
# SEE ALSO
[https://github.com/kraih/mojo](https://github.com/kraih/mojo), [Mojolicious::Guides](https://metacpan.org/pod/Mojolicious::Guides),
[Mojo::Promise](https://metacpan.org/pod/Mojo::Promise), [Mojolicious::Plugin](https://metacpan.org/pod/Mojolicious::Plugin)