Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syohex/p5-async-when
Perl port of when.js
https://github.com/syohex/p5-async-when
Last synced: about 19 hours ago
JSON representation
Perl port of when.js
- Host: GitHub
- URL: https://github.com/syohex/p5-async-when
- Owner: syohex
- License: other
- Created: 2013-05-20T03:52:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-20T04:18:25.000Z (over 11 years ago)
- Last Synced: 2024-11-09T06:08:38.634Z (about 2 months ago)
- Language: Perl
- Homepage:
- Size: 117 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Async::When - Perl Port of when.js
# SYNOPSIS
use Async::When;
# DESCRIPTION
Async::When is Perl port of Javascript Library when.js.
The API is kept as close to the original as possible.This is currently a minimal implementation.
# INTERFACES
## Funcional Interface
### When(@values or $promise)
Returns a promise. If the argument is already a promise, it is returned. Otherwise,
a new promise is created and immediately resolved with the provided value.## Class Interfaces
### Async::When::defer
Create a deferred object, equivalent to `Async::When::Deferred-`new>.
The deferred can be split in its resolver and promise parts for better encapsulation.### Async::When::resolve(@values)
Create a deferred and immediately resolves it with `@values`, then returns the promise.
### Async::When::reject(@values)
Create a deferred and immediately rejects it with `@values`, then returns the promise.
### Async::When::all(@promises)
Takes promises or deferreds and returns promise that will either reject when the
first promise rejects, or resolve when all promises have resolved.# SEE ALSO
[https://github.com/cujojs/when](https://github.com/cujojs/when)
[https://github.com/cjohansen/when-rb](https://github.com/cjohansen/when-rb)
# LICENSE
Copyright (C) Syohei YOSHIDA.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
Syohei YOSHIDA