博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Seatsar mini-tutorial(2)
阅读量:3575 次
发布时间:2019-05-20

本文共 898 字,大约阅读时间需要 2 分钟。

Future and promise

A future is a result of a computation that may not be available yet. Examples include:

未来是计算的结果,可能尚未可用,例如:

a data buffer that we are reading from the network 我们从网络中读取的数据缓冲区

the expiration of a timer 计时器的期限
the completion of a disk write 完成磁盘写入
the result computation that requires the values from one or more other futures. 需要一个或多个其他期货价值的结果计算
a promise is an object or function that provides you with a future, with the expectation that it will fulfill the future.

一个承诺是一个目标或者功能,它为你提供了一个未来,期望它能够实现未来。

Promises and futures simplify asynchronous programming since they decouple the event producer (the promise) and the event consumer (whoever uses the future). Whether the promise is fulfilled before the future is consumed, or vice versa, does not change the outcome of the code.

允诺和未来简化了异步编程,因为它们将事件生产者(允诺)和事件消费者(使用未来的人)分离开来。 无论承诺是否在未来消耗之前实现,或者反之亦然,都不会改变代码的结果。

Consuming a future

转载地址:http://ujxgj.baihongyu.com/

你可能感兴趣的文章
建表参数(pctfree,IniTrans,maxtrans)含义
查看>>
springBoot官方入门篇一 引入依赖并运行
查看>>
java大牛25点
查看>>
LSTM 讲解
查看>>
SpringBoot中启动的端口与设置的端口不一致
查看>>
Lua 元表及元方法
查看>>
JAVA 继承
查看>>
电脑键盘突然不能打字,很多键变成快捷键了
查看>>
nowcoder 左神算法1
查看>>
code刷题
查看>>
学习日记03
查看>>
学习日记04
查看>>
js自定义数据顺序进行升序或者降序排序
查看>>
【零】简单数仓框架优化、配置及基准测试
查看>>
Sqoop的安装及测试
查看>>
Kylin的简单使用
查看>>
Presto的概念和安装使用
查看>>
Druid的Web页面使用
查看>>
Scala-HelloWorld
查看>>
Scala-IDEA中环境部署
查看>>