Zesstra | 3085c66 | 2025-08-02 18:31:10 +0200 | [diff] [blame] | 1 | NAME |
| 2 | async |
| 3 | |
| 4 | SYNTAX |
| 5 | /* function */ |
| 6 | async <modifiers> <type> name ( <arguments> ) |
| 7 | { |
| 8 | statements... |
| 9 | } |
| 10 | |
| 11 | /* inline closure */ |
| 12 | async function <type> ( ) : <context> |
| 13 | { |
| 14 | statements... |
| 15 | } |
| 16 | |
| 17 | DESCRIPTION |
| 18 | The async modifer turns a function or inline closure into a coroutine. |
| 19 | |
| 20 | If the function is called it will immediately return a coroutine |
| 21 | object that will represent the remainder of the function's execution. |
| 22 | |
| 23 | The inline closure notation will not result in a closure, but a |
| 24 | coroutine object. |
| 25 | |
| 26 | HISTORY |
| 27 | Coroutines were introduced in LDMud 3.6.5. |
| 28 | |
| 29 | SEE ALSO |
| 30 | coroutines(LPC), await(LPC), yield(LPC), foreach(LPC), |
| 31 | call_coroutine(E), this_coroutine(E) |
| 32 | |