Show raw api
{
"functions": [
{
"name": "addPlugin",
"desc": "Initializes a plugin with the scheduler, see the [Plugin Docs](/docs/plugins) for more information.\r",
"params": [
{
"name": "plugin",
"desc": "",
"lua_type": "PlanckPlugin"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 51,
"path": "src/Scheduler.luau"
}
},
{
"name": "getDeltaTime",
"desc": "Returns the time since the system was ran last.\nThis must be used within a registered system.\r",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "number"
}
],
"function_type": "method",
"source": {
"line": 68,
"path": "src/Scheduler.luau"
}
},
{
"name": "run",
"desc": "Runs all Systems tagged with the Phase in order.\r",
"params": [
{
"name": "phase",
"desc": "",
"lua_type": "Phase"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 267,
"path": "src/Scheduler.luau"
}
},
{
"name": "run",
"desc": "Runs all Systems tagged with any Phase within the Pipeline in order.\r",
"params": [
{
"name": "pipeline",
"desc": "",
"lua_type": "Pipeline"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 274,
"path": "src/Scheduler.luau"
}
},
{
"name": "run",
"desc": "Runs the System, passing in the arguments of the Scheduler, `U...`.\r",
"params": [
{
"name": "system",
"desc": "",
"lua_type": "System"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 281,
"path": "src/Scheduler.luau"
}
},
{
"name": "runAll",
"desc": "Runs all Systems within order.\n:::note\nWhen you add a Pipeline or Phase with an event, it will be grouped\nwith other Pipelines/Phases on that event. Otherwise, it will be\nadded to the default group.\nWhen not running systems on Events, such as with the `runAll` method,\nthe Default group will be ran first, and then each Event Group in the\norder created.\nPipelines/Phases in these groups are still ordered by their dependencies\nand by the order of insertion.\n:::\r",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 320,
"path": "src/Scheduler.luau"
}
},
{
"name": "insert",
"desc": "Initializes the Phase within the Scheduler, ordering it implicitly by\nsetting it as a dependent of the previous Phase/Pipeline.\r",
"params": [
{
"name": "phase",
"desc": "",
"lua_type": "Phase"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 352,
"path": "src/Scheduler.luau"
}
},
{
"name": "insert",
"desc": "Initializes the Pipeline and it's Phases within the Scheduler,\nordering the Pipeline implicitly by setting it as a dependent\nof the previous Phase/Pipeline.\r",
"params": [
{
"name": "pipeline",
"desc": "",
"lua_type": "Pipeline"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 361,
"path": "src/Scheduler.luau"
}
},
{
"name": "insert",
"desc": "Initializes the Phase within the Scheduler, ordering it implicitly\nby setting it as a dependent of the previous Phase/Pipeline, and\nscheduling it to be ran on the specified event.\n```lua\nlocal myScheduler = Scheduler.new()\n :insert(myPhase, RunService, \"Heartbeat\")\n```\r",
"params": [
{
"name": "phase",
"desc": "",
"lua_type": "Phase"
},
{
"name": "instance",
"desc": "",
"lua_type": "Instance | EventLike"
},
{
"name": "event",
"desc": "",
"lua_type": "string | EventLike"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 377,
"path": "src/Scheduler.luau"
}
},
{
"name": "insert",
"desc": "Initializes the Pipeline and it's Phases within the Scheduler,\nordering the Pipeline implicitly by setting it as a dependent of\nthe previous Phase/Pipeline, and scheduling it to be ran on the\nspecified event.\n```lua\nlocal myScheduler = Scheduler.new()\n :insert(myPipeline, RunService, \"Heartbeat\")\n```\r",
"params": [
{
"name": "pipeline",
"desc": "",
"lua_type": "Pipeline"
},
{
"name": "instance",
"desc": "",
"lua_type": "Instance | EventLike"
},
{
"name": "event",
"desc": "",
"lua_type": "string | EventLike"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 394,
"path": "src/Scheduler.luau"
}
},
{
"name": "insertAfter",
"desc": "Initializes the Phase within the Scheduler, ordering it\nexplicitly by setting the after Phase/Pipeline as a dependent.\r",
"params": [
{
"name": "phase",
"desc": "",
"lua_type": "Phase"
},
{
"name": "after",
"desc": "",
"lua_type": "Phase | Pipeline"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 430,
"path": "src/Scheduler.luau"
}
},
{
"name": "insertAfter",
"desc": "Initializes the Pipeline and it's Phases within the Scheduler,\nordering the Pipeline explicitly by setting the after Phase/Pipeline\nas a dependent.\r",
"params": [
{
"name": "pipeline",
"desc": "",
"lua_type": "Pipeline"
},
{
"name": "after",
"desc": "",
"lua_type": "Phase | Pipeline"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 440,
"path": "src/Scheduler.luau"
}
},
{
"name": "insertBefore",
"desc": "Initializes the Phase within the Scheduler, ordering it\nexplicitly by setting the before Phase/Pipeline as a dependency.\r",
"params": [
{
"name": "phase",
"desc": "",
"lua_type": "Phase"
},
{
"name": "before",
"desc": "",
"lua_type": "Phase | Pipeline"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 470,
"path": "src/Scheduler.luau"
}
},
{
"name": "insertBefore",
"desc": "Initializes the Pipeline and it's Phases within the Scheduler,\nordering the Pipeline explicitly by setting the before Phase/Pipeline\nas a dependency.\r",
"params": [
{
"name": "pipeline",
"desc": "",
"lua_type": "Pipeline"
},
{
"name": "before",
"desc": "",
"lua_type": "Phase | Pipeline"
}
],
"returns": [
{
"desc": "",
"lua_type": "Scheduler"
}
],
"function_type": "method",
"source": {
"line": 480,
"path": "src/Scheduler.luau"
}
},
{
"name": "addSystems",
"desc": "Adds the System to the Scheduler, scheduling it to be ran\nimplicitly within the provided Phase or on the default Main phase.\r",
"params": [
{
"name": "systems",
"desc": "",
"lua_type": "System"
},
{
"name": "phase",
"desc": "",
"lua_type": "Phase?"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 509,
"path": "src/Scheduler.luau"
}
},
{
"name": "addSystems",
"desc": "Adds the Systems to the Scheduler, scheduling them to be ran\nimplicitly within the provided Phase or on the default Main phase.\r",
"params": [
{
"name": "systems",
"desc": "",
"lua_type": "{ System }"
},
{
"name": "phase",
"desc": "",
"lua_type": "Phase?"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 562,
"path": "src/Scheduler.luau"
}
},
{
"name": "editSystem",
"desc": "Changes the Phase that this system is scheduled on.\r",
"params": [
{
"name": "system",
"desc": "",
"lua_type": "System"
},
{
"name": "newPhase",
"desc": "",
"lua_type": "Phase"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 597,
"path": "src/Scheduler.luau"
}
},
{
"name": "removeSystem",
"desc": "Removes the System from the Scheduler.\r",
"params": [
{
"name": "system",
"desc": "",
"lua_type": "System"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 643,
"path": "src/Scheduler.luau"
}
},
{
"name": "replaceSystem",
"desc": "Replaces the System with a new System.\r",
"params": [
{
"name": "old",
"desc": "",
"lua_type": "System"
},
{
"name": "new",
"desc": "",
"lua_type": "System"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 678,
"path": "src/Scheduler.luau"
}
},
{
"name": "addRunCondition",
"desc": "Adds a Run Condition which the Scheduler will check before\nthis System is ran.\r",
"params": [
{
"name": "system",
"desc": "",
"lua_type": "System"
},
{
"name": "fn",
"desc": "",
"lua_type": "(U...) -> boolean"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 720,
"path": "src/Scheduler.luau"
}
},
{
"name": "addRunCondition",
"desc": "Adds a Run Condition which the Scheduler will check before\nany Systems within this Phase are ran.\r",
"params": [
{
"name": "phase",
"desc": "",
"lua_type": "Phase"
},
{
"name": "fn",
"desc": "",
"lua_type": "(U...) -> boolean"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 728,
"path": "src/Scheduler.luau"
}
},
{
"name": "addRunCondition",
"desc": "Adds a Run Condition which the Scheduler will check before\nany Systems within any Phases apart of this Pipeline are ran.\\\r",
"params": [
{
"name": "pipeline",
"desc": "",
"lua_type": "Pipeline"
},
{
"name": "fn",
"desc": "",
"lua_type": "(U...) -> boolean"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 736,
"path": "src/Scheduler.luau"
}
},
{
"name": "cleanup",
"desc": "Disconnects all events, closes all threads, and performs\nother cleanup work.\n:::danger\nOnly use this if you intend to not use the associated\nScheduler anymore. It will not work as intended.\nYou should dereference the scheduler object so that\nit may be garbage collected.\n:::\n:::warning\nIf you're creating a \"throwaway\" scheduler, you should\nnot add plugins like Jabby or the Matter Debugger to it.\nThese plugins are unable to properly be cleaned up, use\nthem with caution.\n:::\r",
"params": [],
"returns": [],
"function_type": "method",
"source": {
"line": 848,
"path": "src/Scheduler.luau"
}
},
{
"name": "new",
"desc": "Creates a new Scheduler, the args passed will be passed to\nany System anytime it is ran by the Scheduler.\r",
"params": [
{
"name": "args",
"desc": "",
"lua_type": "U..."
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 876,
"path": "src/Scheduler.luau"
}
}
],
"properties": [],
"types": [
{
"name": "SystemFn",
"desc": "",
"lua_type": "((U...) -> any)",
"source": {
"line": 25,
"path": "src/Scheduler.luau"
}
},
{
"name": "SystemTable",
"desc": "",
"fields": [
{
"name": "system",
"lua_type": "SystemFn<U...>",
"desc": ""
},
{
"name": "phase",
"lua_type": "Phase?",
"desc": ""
},
{
"name": "[any]",
"lua_type": "any",
"desc": ""
}
],
"source": {
"line": 31,
"path": "src/Scheduler.luau"
}
},
{
"name": "System",
"desc": "",
"lua_type": "SystemFn<U...> | SystemTable<U...>",
"source": {
"line": 34,
"path": "src/Scheduler.luau"
}
}
],
"name": "Scheduler",
"desc": "An Object which handles scheduling Systems to run within different\nPhases. The order of which Systems run will be defined either\nimplicitly by when it was added, or explicitly by tagging the system\nwith a Phase.\r",
"source": {
"line": 41,
"path": "src/Scheduler.luau"
}
}