JavaScript Promiseの本 v178 Promise.prototype.doneとは何か? ..... 88 Promiseとメソッドチェーン ..... 94 Promiseによる逐次処理 ..... 102 Promises API Reference ..... 110 Promise#then ..... 110 Promise#catch ..... 110 Promise.resolve .. Korean: #### eBook JavaScript Promise(####)² ## はじめに ## 書籍の目的 この書籍はJavaScript標準仕様のECMAScript 6 Promisesという仕様を中心にし、JavaScriptにおけるPromiseについて学ぶことを目的とした書籍です。 この書籍を読むことで学べることとして次の3つを目標としています • Promiseに うになること • Promiseの向き不向きについて学び、何でもPromiseで解決するべきではないと知ること • ES6 Promisesを元に基本をよく学び、より発展した形を自分で形成できるようになること この書籍では、先程も述べたようにES6 Promises、つまりJavaScriptの標準仕様(ECMAScript)をベースとしたPromiseについて書かれています。 そのため、0 码力 | 115 页 | 1.06 MB | 2 年前3
From Eager Futures/Promises to Lazy Continuations: Evolving an Actor Library Based on Lessons Learned## From Eager Futures/Promises to Lazy Continuations Evolving an Actor Library Based on Lessons Learned from Large-Scale Deployments ## prologue • past life at UC Berkeley, Twitter, Mesosphere/D2iQ Nikita (@FolMing), Zakhar (@onelxj), and Artur (@ArthurBandaryk) ## chapters (1) motivating futures/promises + actors (2) libprocess (3) revisiting the problem (4) evolution of libprocess (5) eventuals eventuals (6) scheduling (7) streams (8) type erasure ## chapters (1) motivating futures/promises + actors (2) libprocess (3) revisiting the problem (4) evolution of libprocess (5) eventuals (6) scheduling0 码力 | 264 页 | 588.96 KB | 1 年前3
JavaScript Promise迷你书(中文版)prototype.done? ..... 85 Promise和方法链(method chain) ..... 91 使用Promise进行顺序(sequence)处理 ..... 99 Promises API Reference ..... 107 Promise#then ..... 107 Promise#catch ..... 107 Promise.resolve .. 6 Promises规范为中心,着重向各位读者介绍JavaScript中对Promise相关技术的支持情况。 通过阅读本书,我们希望各位读者能在下面三个目标上有所收获。 - 学习Promise相关内容,能熟练使用Promise模式并进行测试 - 学习Promise适合什么、不适合什么,知道Promise不是万能的,不能什么都想用Promise来解决 - 以ES6 Promises为基础进行学习,逐渐发展形成自己的风格 Promises为基础进行学习,逐渐发展形成自己的风格 像上面所提到的那样,本书主要是以ES6 Promises,即JavaScript的标准规范为基础的、Promise的相关知识为主要讲解内容。 在Firefox和Chrome这样技术比较超前的浏览器上,不需要安装额外的插件就能使用Promise功能,此外ES6 Promises的规范来源于Promises/A+社区,它有很多版本的实现。 我们将会从基础API开始介绍可以在0 码力 | 112 页 | 1010.02 KB | 2 年前3
JavaScript Promiseの本 v2Function 116 Async Functionとは 116 Async Functionの構文 119 await 式 121 Async Functionと配列 124 Promises API Reference 131 Promise#then 131 Promise#catch 132 Promise#finally 132 Promise.resolve この書籍はJavaScript標準仕様のECMAScript Promisesを中心にし、JavaScriptにおけるPromiseについて学ぶことが目的です。 この書籍では、次の3つを目標としています。 • Promiseについて学び、パターンやテストを扱えること • Promiseの向き不向きについて学び、何でもPromiseで解決するべきではないと知ること • ES Promisesを元に基本をよく学び、より発展した形を自分で形成できること きること この書籍では、先程も述べたようにES Promises、つまりJavaScriptの標準仕様(ECMAScript)をベースとしたPromiseについて書かれています。 そのため、FirefoxやChromeなどモダンなブラウザでは、ライブラリを使うこと無く利用できる機能であり、またES Promisesは元がPromises/A+というコミュニティベースの仕様であるため、多くの実装ライブラリがあります。0 码力 | 137 页 | 1.17 MB | 2 年前3
The Node.js Handbook
objects ☐ 46.3. Handling exceptions ☐ 46.4. Catching uncaught exceptions 46.5. Exceptions with promises ☐ 46.6. Error handling with async/await • 47. Build an HTTP Server • 48. Making HTTP requests which is one fundamental part of Node.js: • Asynchronous programming and callbacks • Timers • Promises • Async and Await • Closures • The Event Loop ### 5. Differences between Node and the Browser is the exception, and this is why JavaScript is based so much on callbacks, and more recently on promises and async/await. #### 28.3. The call stack The call stack is a LIFO (Last In, First Out) stack0 码力 | 161 页 | 1.66 MB | 2 年前3
Guzzle PHP 7.0 Documentationreturned by these methods implements the Promises/A+ spec [https://promisesaplus.com/], provided by the Guzzle promises library. [https://github.com/guzzle/promises]. This means that you can chain then() >getMethod(); } ); ## Concurrent requests You can send multiple requests concurrently using promises and asynchronous requests. use GuzzleHttp\Client; use GuzzleHttp\Promise; $client = new Clien Client(['base_uri' => 'http://httpbin.org/'); // Initiate each request but do not block $promises = [ 'image' => $client->getAsync('/image'), 'png' => $0 码力 | 64 页 | 310.93 KB | 1 年前3
ES6 Tutorial.302 WeakMap .....303 Set .....304 WeakSet .....309 30. ES6 – PROMISES ..... 311 Promise Syntax ..... 311 Promises Chaining ..... 312 promise.all() ..... 314 promise.race() • Classes • Iterators Generators • Collections • New built in methods for various classes • Promises ## ECMAScript Versions There are nine editions of ECMA-262 which are as follows: |Edition|Name|Description| Example var a = 12; var b = 10; a = b; console.log("a=b:" + a); a += b; console.log("a+=b:" + a); a -= b; console.log("a-=b:" + a); a *= b; console.log("a*=b:" + a); a0 码力 | 435 页 | 4.00 MB | 2 年前3
Guzzle PHP v5 Documentationreturned by these methods implements the Promises/A+ spec [https://promisesaplus.com/], provided by the Guzzle promises library. [https://github.com/guzzle/promises]. This means that you can chain then() >getMethod(); } ); ## Concurrent requests You can send multiple requests concurrently using promises and asynchronous requests. use GuzzleHttp\Client; use GuzzleHttp\Promise; $client = new Clien Client(['base_uri' => 'http://httpbin.org/'); // Initiate each request but do not block $promises = [ 'image' => $client->getAsync('/image'), 'png' => $client-&0 码力 | 62 页 | 309.78 KB | 1 年前3
Guzzle PHP 6.5 Documentationreturned by these methods implements the Promises/A+ spec [https://promisesaplus.com/], provided by the Guzzle promises library. [https://github.com/guzzle/promises]. This means that you can chain then() >getMethod(); } ); ## Concurrent requests You can send multiple requests concurrently using promises and asynchronous requests. use GuzzleHttp\Client; use GuzzleHttp\Promise; $client = new Clien Client(['base_uri' => 'http://httpbin.org/'); // Initiate each request but do not block $promises = [ 'image' => $client->getAsync('/image'), 'png' => $0 码力 | 65 页 | 311.42 KB | 1 年前3
阮一峰 JavaScript 教程上一小节的三个量词符,默认情况下都是最大可能匹配,即匹配直到下一个字符不满足匹配规则为止。这被称为贪婪模式。 1. var s = 'aaa'; 2. s.match(/a+/) // ["aaa"] 上面代码中,模式是 $ /a+// $ ,表示匹配1个 $ \boxed{a} $ 或多个 $ \boxed{a} $ ,那么到底会匹配几个 $ \boxed{a} $ 呢?因为默认是贪婪模式,会一直匹配到字符 \boxed{a} $ 。 如果想将贪婪模式改为非贪婪模式,可以在量词符后面加一个问号。 1. var s = 'aaa'; 2. s.match(/a+?//["a"] 上面代码中,模式结尾添加了一个问号 $ /a+? $ ,这时就改为非贪婪模式,一旦条件满足,就不再往下匹配。 除了非贪婪模式的加号,还有非贪婪模式的星号( $ ^{*} $ )。 • *?:表示某个 Promise 的写法 13. (new Promise(step1)) 14. .then(step2) 15. .then(step3) 16. .then(step4); 从上面代码可以看到,采用 Promises 以后,程序流程变得非常清楚,十分易读。注意,为了便于理解,上面代码的 Promise 实例的生成格式,做了简化,真正的语法请参照下文。 总的来说,传统的回调函数写法使得代码混成一团,变得横向发展而不是向下发展。Promise0 码力 | 540 页 | 3.32 MB | 1 年前3
共 392 条
- 1
- 2
- 3
- 4
- 5
- 6
- 40
相关搜索词
PromiseJavaScriptPolyfillPromises/A+ライブラリFutures/PromisesActorsLazy ContinuationsEventualsSchedulingPromise.allPromise.race异步处理Promise链非同期処理thenablePromiseチェーンXHRNode.jsnpmV8引擎事件循环HTTP clientPSR-7异步请求请求处理中间件ES6ECMAScript模块类GuzzleSynchronous/asynchronous requestsMiddleware system同步和异步请求PSR-7接口中间件系统环境无关性教程语法编程语言浏览器













