-
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: Scheduler
Tron edited this page Jan 13, 2023
·
1 revision
Often times handlers have to be executed at specific period; For instance, you may want to perform some special task right after Assetify's library or modules are loaded/unloaded etc or you may simply want to schedule the handlers and boot them all together at your own specific period for some special purpose. Exactly why scheduler
exists!
Add the below code once in either of the shared .lua
script of the resource you want to use within:
--Declare it globally only once
loadstring(exports.assetify_library:import("scheduler"))()
local bool: result = assetify.scheduler.execOnBoot(
function: exec
)
local bool: result = assetify.scheduler.execOnLoad(
function: exec
)
local bool: result = assetify.scheduler.execOnModuleLoad(
function: exec
)
local bool: result = assetify.scheduler.execOnResourceLoad(
function: exec
)
local bool: result = assetify.scheduler.execOnResourceFlush(
function: exec
)
local bool: result = assetify.scheduler.execOnResourceUnload(
function: exec
)
⚠️ 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
)
⚠️ 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
)
⚠️ 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
)
⚠️ 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
)
⚠️ 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
)
@Objective: 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
)
local bool: result = assetify.scheduler.boot()