public interface FutureListener
| 限定符和类型 | 方法和说明 |
|---|---|
void |
operationComplete(Future future)
建议做一些比较简单的低功耗的操作
注意一些反模式:
1) 死循环:
operationComplete(Future future) {
......
|
void operationComplete(Future future) throws Exception
建议做一些比较简单的低功耗的操作
注意一些反模式:
1) 死循环:
operationComplete(Future future) {
......
future.addListener(this); // 类似于这种操作,后果你懂的
......
}
2)耗资源操作或者慢操作:
operationComplete(Future future) {
......
Thread.sleep(500);
......
}
future - ExceptionCopyright © 2016. All rights reserved.