Module
The link for the module is here.
About
This Module allows you to fire functions with set arguements in a sequence at a certain rate. This is usefull for using external APIs that have rate limits.
API
Methods:
RateScheduleService.new()
function RateScheduleService.new(Rate:number)
Creates a new schedule object with a given rate, default rate is 1.
ScheduleObject:run()
function ScheduleObject:run()
Invokes the functions in the schedule at the ScheduleObject’s Rate. Yieldable.
Note: If the ScheduleObject has been yielded, it can only be resumed by :resume()
, trying to run this after a yield would not run it.
ScheduleObject:yield()
function ScheduleObject:yield()
Yields running the schedule until ScheduleObject:resume()
is run.
ScheduleObject:resume()
function ScheduleObject:resume()
Unyields the schedule.
ScheduleObject:clear()
function ScheduleObject:clear()
Clears the ScheduleObject’s schedule.
ScheduleObject:add()
function ScheduleObject:add(func:function,...)
Adds a function to the schedule, arguements can be provided.
ScheduleObject:remove()
function ScheduleObject:remove(index:number)
Removes an index from the schedule.
ScheduleObject:SetRate()
function ScheduleObject:SetRate(Rate:number)
Sets the ScheduleObject’s Rate to the one provided.
This module is deprecated and has been replaced by the FuncRate Module.