coroutine
coroutine library
Coroutines are similar to threads, however they do not run simultaneously.
They offer a way to split up tasks and dynamically pause & resume functions.
Functions
coroutine.isyieldable | Returns true when the running coroutine can yield. |
coroutine.running | |
coroutine.wait | Repeatedly yields the coroutine for the given duration before continuing. |
#coroutine.isyieldable
function coroutine.isyieldable(): boolean
Returns true when the running coroutine can yield.
View documents
Returns
| Type | Name | Description |
|---|---|---|
boolean | is_yieldable |
#coroutine.running
function coroutine.running(): running
Returns
| Type | Name | Description |
|---|---|---|
running |
#coroutine.wait
async function coroutine.wait(seconds: number)
Repeatedly yields the coroutine for the given duration before continuing.
Parameters
| Name | Type | Description |
|---|---|---|
seconds | number |