Skip to content

Library: Scheduler

ᴏᴠ ━ ᴀɴɪꜱᴀ edited this page Dec 5, 2024 · 11 revisions

» Overview

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.

» Importing

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"))()

» APIs

  • assetify.scheduler.execOnBoot() - shared

    Executes specified function as soon as the library gets booted.

    local bool: result = assetify.scheduler.execOnBoot(
       function: exec
    )
  • assetify.scheduler.execOnLoad() - shared

    Executes specified function as soon as the library gets loaded.

    local bool: result = assetify.scheduler.execOnLoad(
       function: exec
    )
  • assetify.scheduler.execOnModuleLoad() - shared

    Executes specified function as soon as the library's modules gets loaded.

    local bool: result = assetify.scheduler.execOnModuleLoad(
       function: exec
    )
  • assetify.scheduler.execOnResourceLoad() - shared

    Executes specified function as soon as the current hooked resource gets loaded.

    local bool: result = assetify.scheduler.execOnResourceLoad(
       function: exec
    )
  • assetify.scheduler.execOnResourceFlush() - shared

    Executes specified function as soon as the current hooked resource gets flushed.

    local bool: result = assetify.scheduler.execOnResourceFlush(
       function: exec
    )
  • assetify.scheduler.execOnResourceUnload() - shared

    Executes specified function as soon as the current hooked resource gets unloaded.

    local bool: result = assetify.scheduler.execOnResourceUnload(
       function: exec
    )
  • assetify.scheduler.execScheduleOnBoot() - shared

    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
    )
  • assetify.scheduler.execScheduleOnLoad() - shared

    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
    )
  • assetify.scheduler.execScheduleOnModuleLoad() - shared

    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
    )
  • assetify.scheduler.execScheduleOnResourceLoad() - shared

    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
    )
  • assetify.scheduler.execScheduleOnResourceFlush() - shared

    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
    )
  • assetify.scheduler.execScheduleOnResourceUnload() - shared

    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
    )
  • assetify.scheduler.boot() - shared

    Boots up all scheduled executions.

    local bool: result = assetify.scheduler.boot()
Clone this wiki locally