Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
Promise ã§ã®éåæå¦çæãæä»å¶å¾¡ãæ ã£ãã°ã£ããã«ãã°ãåºãã¦ãã¾ã£ãããããªçµé¨ããã¾ããããç§ã¯ããã¾ãã ã¹ã¬ããã使ãå ´åãMutex ã synchronized çã ã大æµæä»å¶å¾¡ãè¡ãã©ã¤ãã©ãªãæ§æãªã©ãã»ããã§ã¤ãã¦ããã®ã ãã©ãPromise/A+ ã«ã¯ç¡ãã®ã§èªåã§å¶å¾¡ããå¿ è¦ãããã ãªã®ã§ãPromise ã§æä»å¶å¾¡ãåºæ¥ãã©ã¤ãã©ãªã npm ãã調ã¹ããã¼ããç©äºã¤ãããã¯ã¢ãããã¦ã¿ãã async-lock https://www.npmjs.com/package/async-lock ä¸çªã¡ã¸ã£ã¼ã£ã½ãã©ã¤ãã©ãªããã¦ã³ãã¼ãæ°ãå¤ãã ããã¯åå¾æãkey ãæå®ãã redis ã® key ã® set ã®ããã«ãkey ãã¨ã«æä»å¶å¾¡ãããå ´åã«ä¾¿å© ã¿ã¤ã ã¢ã¦ãã®ãµãã¼ã å¾ ã¡åãã¿ã¹ã¯æ°ã®ä¸éã®ãµãã¼ã ã¤ã³ã¿ã¼ãã§ã¤ã¹ããacqui
Promiseã¨ã¯ Promiseã¯éåæå¦çãæ½è±¡åãããªãã¸ã§ã¯ãã¨ãããæä½ããä»çµã¿ã®äºãããã¾ãã åèï¼JavaScript Promiseã®æ¬ ãã®ã¨ã³ããªã¼ã¯ï¼ Promiseã«ã¤ãã¦ããããåå¼·ããçµæã èªåã®ãªãã§ããããæ¸ãæ¹ãããããããããªãã¨ã¾ã¨ããå 容ã§ãã ä»å¾ã使ããããªã®ã§ãã³ãã¬ã¼ãã«ãã¦ããã¾ããã ã½ã¼ã¹ Promiseå¦çãé çªã«å¦çãããå ´å call_async_process.process_A(params) .then(function(value) { // æåæï¼ä½ãå¦ç //ã次ã®é¢æ°ã®å¼æ° return proaRes }) .then(call_async_process.process_B) .then(function(value) { // æåæï¼ä½ãå¦ç //ã次ã®é¢æ°ã®å¼æ° return probRes })
ç®æ¬¡ 1. ã¯ããã« 2. Promiseã®æ¦å¿µãç解ãã å¹éï¼è¡åãå«ããªå¥³ã®å 2.1 Promiseã¨ã¯ä½ãï¼ å¹éï¼å®è¡é åº 2.2 Promiseã¨ä¸¦è¡å¦ç å¹éï¼å¼ã®æ½è±¡å 3. Promiseã®ãããããç解ãã 3.1. Promiseã§å¼ãé åºä»ããã 3.2. æå°éã®Promiseå®è¡ 4.Promiseã¨ã¨ã©ã¼å¦ç å¹éï¼è¨ç®å¤±æã®å ´å 4.1. ã¨ã©ã¼ãPromiseã§å¦çãã 4.2. Promiseã®å¤±æã®ä¼æ 5. Promiseã®çµå 5.1. Promiseã確å®çã«çµåãã 5.2. Promiseãé確å®çã«çµåãã 6. Promiseã®å®ç¨çãªç解 6.1. ECMAScript Promiseã®å°å ¥ 6.2. .then ã®åæ 7. Promiseã¨ã¯ç¸æ§ãæªãã±ã¼ã¹ã¨ã¯ï¼ 8. ã¾ã¨ã åèæç® è¿½å è³æ è³æã¨ã©ã¤ãã©ãª 1. ã¯ããã«
One of the trickiest aspects of PouchDB is that its API is asynchronous. I see no shortage of confused questions on Stack Overflow, Github, and IRC, and most often they stem from a misunderstanding of callbacks and promises. We can't really help it. PouchDB is an abstraction over IndexedDB, WebSQL, LevelDB (in Node), and CouchDB (via Ajax). All of those APIs are asynchronous; hence PouchDB must be
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}