See: Description
Interface | Description |
---|---|
Future<T> |
A Future is a computation result that becomes available at some point.
|
Promise<T> |
A Promise is a write-once wrapper around a read-only Future which can complete the underlying Future with a value
or an exception.
|
A Future represents an asynchronous read-only task. It is a placeholder for a
value that becomes available at some point. With the help of Future
we efficiently perform many non-blocking
operations in parallel. The value of a Future is supplied concurrently and can subsequently be used. Multiple
concurrent tasks represented by Futures can be composed to a single Future.
While Futures are concurrent read-only tasks, a Promise creates a writable-once
Future. The Promise
is used to complete its contained Future
.
Copyright © 2017. All Rights Reserved.