JobQueue

Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.

ShotInstancecreatablecomingPrograms

Up and coming

Run work a few pieces at a time, with pausing and retries, and a Job for each piece to wait on, show or cancel.

Insert a JobQueue in the project tree and set MaxRunning in Properties, or make one with ProgramService's CreateJobQueue(name, maxRunning). Add queues a piece of work and gives its Job, a child of the queue while it waits or runs. While Paused, running jobs finish and waiting ones wait.

Made with Instance.new("JobQueue") or Clone().

Properties

NameTypeDefaultDescription
MaxRunningnumberHow many jobs run at once; set it in Properties when the queue sits in the project tree.
PausedbooleanWhile true, running jobs finish and waiting ones wait.
RunningCountnumber
WaitingCountnumber

Methods

NameArgumentsReturnsDescription
Add(name: string, work: () -> any, options: { Retries: number?, RetryDelay: number? }?)JobQueues the work under a name and returns its Job; the work may call Async members.
Clear()()Cancels every waiting job.

Events

NamePassesDescription
JobAdded(Job)
Emptied()
From ShotInstance 33