Appearance
Future
Inherits: Class
Methods
Cancel
lua
function Future:Cancel()Marks the future as cancelled and cleans it up.
Done
lua
function Future:Done(value)Marks the future as done with the specified result value.
Parameters:
| Name | Type | Description |
|---|---|---|
value | T | The result value |
GetName
lua
function Future:GetName()
-> stringGets the name for debugging purposes.
Returns:
| Type | Description |
|---|---|
string |
GetValue
lua
function Future:GetValue()
-> <T>Gets the result value from a future in the done state.
Returns:
| Type | Description |
|---|---|
<T> |
IsDone
lua
function Future:IsDone()
-> booleanReturns whether or not the future is done.
Returns:
| Type | Description |
|---|---|
boolean |
SetScript
lua
function Future:SetScript(script, handler)Registers a script handler.
Parameters:
| Name | Type | Description |
|---|---|---|
script | "OnDone" | "OnCleanup" | The script to register for |
handler | function | The script handler |
Start
lua
function Future:Start()Marks the future as started.
_Reset
lua
function Future:_Reset()__init
lua
function Future:__init(name)Parameters:
| Name | Type | Description |
|---|---|---|
name | `` |
__tostring
lua
function Future:__tostring()Functions
New
lua
function Future.New(name)
-> FutureCreate a new future.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | The name of the future for debugging purposes |
Returns:
| Type | Description |
|---|---|
Future |