Skip to main content

TaskGroup

A utility for managing concurrent tasks and awaiting their completion.

Functions

new

TaskGroup.new() → TaskGroup

Creates a new TaskGroup instance.

add

TaskGroup:add(
callback(...any) → ...any,
...any
) → ()

Adds a new task to be executed concurrently.

wait

TaskGroup:wait() → ()

Waits for all tasks to complete.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new TaskGroup instance.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TaskGroup\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 15,
                "path": "src/Util/TaskGroup.luau"
            }
        },
        {
            "name": "add",
            "desc": "Adds a new task to be executed concurrently.",
            "params": [
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(...any) -> ...any"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 24,
                "path": "src/Util/TaskGroup.luau"
            }
        },
        {
            "name": "wait",
            "desc": "Waits for all tasks to complete.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 44,
                "path": "src/Util/TaskGroup.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "TaskGroup",
    "desc": "A utility for managing concurrent tasks and awaiting their completion.",
    "source": {
        "line": 3,
        "path": "src/Util/TaskGroup.luau"
    }
}