promise VS future

Posted 风来了

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了promise VS future相关的知识,希望对你有一定的参考价值。

Future and Promise are the two separate sides of an asynchronous operation.

promise is used by the "producer/writer" of the asynchronous operation.

future is used by the "consumer/reader" of the asynchronous operation.

以上是关于promise VS future的主要内容,如果未能解决你的问题,请参考以下文章

c++ 中的 std::promise 和 std::future

[译] 探究 Swift 中的 Futures & Promises

VSCode自定义代码片段12——JavaScript的Promise对象

VSCode自定义代码片段12——JavaScript的Promise对象

c++中的异步编程——future,promise

Future和Promise的分析