Skip to main content

scheduler

Library

Contains functions to interact with the raw task scheduler.

Types

SchedulerJobName

type SchedulerJobName = "RenderJob" | "WaitingHybridScriptsJob" | "ModelMeshJob" | "GcJob" | "HeartbeatTask" | "PhysicsJob" | "PathUpdateJob" | "NavigationJob" | "GenericDataModelJob" | "HttpRbxApiJob"

Functions

connectprestep

scheduler.connectprestep(
jobNameSchedulerJobName,
callback(T...) → U...
) → SchedulerJobStepConnection

Connects a function to run before a Step of the specified job is ran.

Callback Note

The callback you provide CANNOT yield or block the thread, or you will block the roblox main thread.

Errors

TypeDescription
Unknown JobThis job doesn't exist or is not supported.

connectpoststep

scheduler.connectpoststep(
jobNameSchedulerJobName,
callback(T...) → U...
) → SchedulerJobStepConnection

Connects a function to run after a Step of the specified job is ran.

Callback Note

The callback you provide CANNOT yield or block the thread, or you will block the roblox main thread.

Errors

TypeDescription
Unknown JobThis job doesn't exist or is not supported.
Show raw api
{
    "functions": [
        {
            "name": "connectprestep",
            "desc": "Connects a function to run before a Step of the specified job is ran.\n\n\n:::warning Callback Note\nThe callback you provide **CANNOT** yield or block the thread, or you will block the roblox main thread.\n:::",
            "params": [
                {
                    "name": "jobName",
                    "desc": "",
                    "lua_type": "SchedulerJobName"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(T...) -> U..."
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SchedulerJobStepConnection"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "Unknown Job",
                    "desc": "This job doesn't exist or is not supported."
                }
            ],
            "source": {
                "line": 25,
                "path": "impl/Libraries/scheduler.luau"
            }
        },
        {
            "name": "connectpoststep",
            "desc": "Connects a function to run after a Step of the specified job is ran.\n\n\n:::warning Callback Note\nThe callback you provide **CANNOT** yield or block the thread, or you will block the roblox main thread.\n:::",
            "params": [
                {
                    "name": "jobName",
                    "desc": "",
                    "lua_type": "SchedulerJobName"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(T...) -> U..."
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SchedulerJobStepConnection"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "Unknown Job",
                    "desc": "This job doesn't exist or is not supported."
                }
            ],
            "source": {
                "line": 40,
                "path": "impl/Libraries/scheduler.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "SchedulerJobName",
            "desc": "",
            "lua_type": "\"RenderJob\" | \"WaitingHybridScriptsJob\" | \"ModelMeshJob\" | \"GcJob\" | \"HeartbeatTask\" | \"PhysicsJob\" | \"PathUpdateJob\" | \"NavigationJob\" | \"GenericDataModelJob\" | \"HttpRbxApiJob\"",
            "source": {
                "line": 13,
                "path": "impl/Libraries/scheduler.luau"
            }
        }
    ],
    "name": "scheduler",
    "desc": "Contains functions to interact with the raw task scheduler.",
    "tags": [
        "Library"
    ],
    "source": {
        "line": 7,
        "path": "impl/Libraries/scheduler.luau"
    }
}