-
-
Notifications
You must be signed in to change notification settings - Fork 2
Library: Scheduler
Handlers frequently need to be executed at designated intervals. For example, you may wish to initiate specific tasks immediately after the Assetify library or its modules are loaded or unloaded. Alternatively, you might want to schedule these handlers to run simultaneously at a particular time for a specific purpose. This is precisely why the scheduler
feature has been implemented.
Add the below code globally once in either of the shared .lua
script of the resource you want to use within:
loadstring(exports.assetify_library:import("scheduler"))()
-
✨ Executes specified function as soon as the library gets booted.
local bool: result = assetify.scheduler.execOnBoot( function: exec )
-
✨ Executes specified function as soon as the library gets loaded.
local bool: result = assetify.scheduler.execOnLoad( function: exec )
-
✨ Executes specified function as soon as the library's modules gets loaded.
local bool: result = assetify.scheduler.execOnModuleLoad( function: exec )
-
✨ Executes specified function as soon as the current hooked resource gets loaded.
local bool: result = assetify.scheduler.execOnResourceLoad( function: exec )
-
✨ Executes specified function as soon as the current hooked resource gets flushed.
local bool: result = assetify.scheduler.execOnResourceFlush( function: exec )
-
✨ Executes specified function as soon as the current hooked resource gets unloaded.
local bool: result = assetify.scheduler.execOnResourceUnload( function: exec )
-
✨ Schedules an execution to be fired as soon as the library gets booted.
🚨 These schedules are inactive by default, you must boot them via assetify.scheduler.boot as per your requirements!local bool: result = assetify.scheduler.execScheduleOnBoot( function: exec )
-
✨ Schedules an execution to be fired as soon as the library gets loaded.
🚨 These schedules are inactive by default, you must boot them via assetify.scheduler.boot as per your requirements!local bool: result = assetify.scheduler.execScheduleOnLoad( function: exec )
-
✨ Schedules an execution to be fired as soon as the library's modules gets loaded.
🚨 These schedules are inactive by default, you must boot them via assetify.scheduler.boot as per your requirements!local bool: result = assetify.scheduler.execScheduleOnModuleLoad( function: exec )
-
✨ Schedules an execution to be fired as soon as the current hooked resource gets loaded.
🚨 These schedules are inactive by default, you must boot them via assetify.scheduler.boot as per your requirements!local bool: result = assetify.scheduler.execScheduleOnResourceLoad( function: exec )
-
✨ Schedules an execution to be fired as soon as the current hooked resource gets flushed.
🚨 These schedules are inactive by default, you must boot them via assetify.scheduler.boot as per your requirements!local bool: result = assetify.scheduler.execScheduleOnResourceFlush( function: exec )
-
✨ Schedules an execution to be fired as soon as the current hooked resource gets unloaded.
🚨 These schedules are inactive by default, you must boot them via assetify.scheduler.boot as per your requirements!local bool: result = assetify.scheduler.execScheduleOnResourceUnload( function: exec )
-
✨ Boots up all scheduled executions.
local bool: result = assetify.scheduler.boot()