Overview
@async marks a function as asynchronous. In GLua, this often means the function calls coroutine.yield and must run inside a coroutine. The annotation affects documentation and async-aware diagnostics. It does not change runtime behavior.
Syntax
Usage
What it does
- Marks the function in hover documentation as async
- Allows tools and linters to warn when an
@asyncfunction is called outside a coroutine context (if that diagnostic is enabled) - Has no runtime effect
Common GMod patterns
GLuaLS supports async-style code that uses coroutines and callbacks. GMod has no built-inawait(), but many addons use helper wrappers for the same pattern.