Skip to content

Latest commit

 

History

History
89 lines (58 loc) · 3.17 KB

File metadata and controls

89 lines (58 loc) · 3.17 KB

JobManager

⬅️ Go back to dev home

 

Table Of Contents

 

Introduction

The JobManager is a module for managing reoccurring intervals, also called jobs.
For example, the updater registers a job by default to handle the update check, which runs every 6 hours.

Jobs are registered at runtime by calling registerJob(job: Job), where job is an object which includes metadata and the function to execute.
This feature is also available to Plugins, as documented on the Creating Plugins page.

The job manager should be used whenever possible to reduce points of failure.
Do not register intervals yourself, let this do it for you.

Please use your browser's search function Ctrl+F to find something specific on this page.

 

JsDocs

JobManager

Kind: global class

new JobManager(controller)

Constructor - The jobManager handles running and managing interval based functions (jobs), like update checks, cleanups, etc.

Param Type Description
controller Controller Reference to the controller object

jobManager.controller : Controller

Reference to the controller object

Kind: instance property of JobManager

jobManager.jobs : Array.<Job>

Collection of all registered jobs

Kind: instance property of JobManager

jobManager.registerJob(job) ⇒ Error | null

Registers a job

Kind: instance method of JobManager
Returns: Error | null - Returns null on success or err on failure, specifying the reason why.

Param Type Description
job Job Object of the job to register

jobManager.unregisterJob(name) ⇒ Error | null

Unregisters a job

Kind: instance method of JobManager
Returns: Error | null - Returns null on success or err on failure, specifying the reason why.

Param Type Description
name string Name of the job to unregister