123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /**
- Zombie Navigator API (ZAPI) documentation
-
- @copyright
- Copyright © 2016 Zombie Navigator Developers
-
- <br /><br />
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- <br /><br />
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- <br /><br />
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see {@link http://www.gnu.org/licenses/}.
-
- <br /><br />
-
- The latest version of the GNU AGPL should be available here:
- {@link https://www.gnu.org/licenses/agpl.html}
-
-
- @file
- @module zombie/async
- @license AGPL-3.0+
- @version 0.6.0
- */
- /*
- This is not a script but a JSDoc documentation source.
- */
- /**
- Asynchronous sleep using Promise
- @example
- const {delay} = require('zombie/async');
- @param {number} s The number of seconds to sleep for
- @returns {Promise}
- @public
- */
- var delay = function () {};
- /**
- Run a generator as a coroutine using Promise
- @example
- const {run} = require('zombie/async');
- run(function* () {
- try {
- let result = yield new Promise(...);
- } catch (e) {
- // rejected
- }
-
- throw new Error();
- })
- .then(function (result) {
- // generator is finished
-
- })
- .catch(function (e) {
- // an error in generator
- });
-
- @param {function} genFunction Generator (coroutine) to run
- @returns {Promise}
- @public
- */
- var run = function () {};
- // vim: ts=4 noet ai ft=js
|