Future
This provides a placeholder that will eventually hold the value returned from a coroutine when it becomes available.
graph BT
N1["Future"] -->|inherits| N2["Any"];
Characteristics
Quality | Value |
---|---|
Inherits | global.Any |
Extends | N/A |
Decorators | #sealed; |
Is enum | false |
Is sealed | true |
Is extern | false |
Is abstract | false |
Is generator | false |
Has value semantics | false |
Has stored properties | true |
Should register destructor | false |
Has atomic memory | false |
Is copy assignable | false |
Is zero initializable | false |
Methods
construct
#default
#Gambol.function.alwaysinline
construct (s strictly @Self) -> Self
wait
#Gambol.function.alwaysinline
wait (s @Self) -> Nil
signal
#Gambol.function.alwaysinline
signal (s @Self) -> Nil
get_value
#Gambol.function.alwaysinline
get_value (s @Self) -> Dynamic
Casts To
- Bool: true if a value is available, false otherwise
Properties
value
value Dynamic
The property that holds the value
exception
exception nom Exception?
holds the exception if the coroutine raised an exception.
has_value
has_value Bool
true if a value is available, false otherwise. Must be checked atomically.
__sem
__sem Semaphore