lang.future
Module lang.future
API
Definitions
The lang.future module corresponds to the future basic type.
future
function cancel(future<any|error> f) returns ()
Requests cancellation of a future.
This sets the cancellation flag in the strand corresponding to f. Each time that a strand yields, it will check the cancellation flag and terminate abnormally if the flag is set.
f
Copyfuture<int> sumFuture = start int:sum(10, 13, 54, 245, 24, 29, 343, 34); sumFuture.cancel();
future<int> sumFuture = start int:sum(10, 13, 54, 245, 24, 29, 343, 34); sumFuture.cancel();
Import
import ballerina/lang.future;
Metadata
Released date: about 1 year ago
Version: 2201.7.1
Compatibility
Platform: java11
Ballerina version: 2201.7.1
GraalVM compatible: Yes
Other versions