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.

 

1.

GenericFutureListener.operationComplete(Future) is directly called by an I/O thread. Therefore, performing a time consuming task or a

blocking operation in the handler method can cause an unexpected pause during I/O. If you need to perform a blocking operation on I/O completion,

try to execute the operation in a different thread using a thread pool.

posted @ 2017-07-28 18:30  等风来。。  Views(267)  Comments(0Edit  收藏  举报
------------------------------------------------------------------------------------------------------------ --------------- 欢迎联系 x.guan.ling@gmail.com--------------- ------------------------------------------------------------------------------------------------------------