Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grassedge/perl-promise-tiny
A promise implementation written in Perl
https://github.com/grassedge/perl-promise-tiny
Last synced: about 1 month ago
JSON representation
A promise implementation written in Perl
- Host: GitHub
- URL: https://github.com/grassedge/perl-promise-tiny
- Owner: grassedge
- License: other
- Created: 2015-07-12T15:25:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-17T05:49:35.000Z (almost 6 years ago)
- Last Synced: 2024-04-14T20:20:27.014Z (7 months ago)
- Language: Perl
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
This module is no longer maintained. Use https://github.com/FGasper/p5-Promise-ES6 instead.
# NAME
Promise::Tiny - A promise implementation written in Perl
# SYNOPSIS
use Promise::Tiny;
my $promise = Promise::Tiny->new(sub {
my ($resolve, $reject) = @_;
some_async_process(..., sub { # callback.
...
if ($error) {
$reject->($error);
} else {
$resolve->('success value');
}
});
})->then(sub {
my ($value) = @_;
print $value # -> success value
}, sub {
my ($error) = @_;
# handle error
});# DESCRIPTION
Promise::Tiny is tiny promise implementation.
Promise::Tiny has same interfaces as ES6 Promise.# LICENSE
Copyright (C) hatz48.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
hatz48