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: 27 days ago
Version: 2201.10.3
Compatibility
Platform: java17
Ballerina version: 2201.10.3
GraalVM compatible: Yes
Other versions
2201.10.3