rss中的关键词统计
pcall 并发执行多个无参方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| future 用法 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CountDownLatch 同步计数器 |
A
Delayensures that some code is either run zero or one time. It's run zero times if the Delay is never derefed.
Delays are also useful for a shared resource between threads.
reference: stackeroverflow
promise
- You create a
promise. That promise object can now be passed to any thread. - You continue with calculations. These can be very complicated calculations involving side-effects, downloading data, user input, database access, other promises – whatever you like. The code will look very much like your mainline code in any program.
- When you’re finished, you can
deliverthe results to that promise object. - Any item that tries to
derefyour promise before you’re finished with your calculation will block until you’re done. Once you’re done and you’vedelivered the promise, the promise won’t block any longer.
clojure atom实现缓存
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clojure mapcat用法 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clojure pmap 用法 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; | |
| ;; clojure.core | |
| ;; 延迟执行并缓存 | |
| ;; add something | |
| (comment | |
| (defmacro delay | |
| "Takes a body of expressions and yields a Delay object that will | |
| invoke the body only the first time it is forced (with force or deref/@), and | |
| will cache the result and return it on all subsequent force | |
| calls. See also - realized?" |