The parallel\Future classFuturesA Future represents the return value or uncaught exception from a task, and exposes an API for cancellation. Example #1 Example showing Future as return value
The above example will output something similar to: Hello World The behaviour of a future also allows it to be used as a simple synchronization point even where the task does not return a value explicitly. Example #2 Example showing Future as synchronization point
The above example will output something similar to: in child .................................................. leaving child parent continues Class synopsisparallel\Future
final
class parallel\Future
{
/* Resolution */
public mixed value()
/* State */
public bool cancelled()
public bool done()
/* Cancellation */
public bool cancel()
}
|