AgendaUnit

flitter-agenda/AgendaUnit~ AgendaUnit

Unit to start the Agenda module. Registers & starts the scheduler and loads jobs from the specified directory.

Constructor

new AgendaUnit(directory)

Source:

Initialize the class. Resolves and stores the directory containing the job definition files.

Parameters:
Name Type Default Description
directory string ./app/jobs

Directory containing the job definition files.

Extends

Methods

(async) cleanup(app) → {Promise.<void>}

Source:
Inherited From:

Cleans up the unit's resources before Flitter closes.

Parameters:
Name Type Description
app module:libflitter/app/FlitterApp~FlitterApp

the Flitter app

Returns:
Type
Promise.<void>

directories() → {Object}

Source:
Overrides:

Returns the directories managed by the AgendaUnit.

Returns:
Type
Object

(async) go(app, context) → {Promise.<void>}

Source:
Overrides:

Initialize the unit. Creates a new instance of the Agenda scheduler and registers the job files with it. The scheduler is then started.

Parameters:
Name Type Description
app module:libflitter/app/FlitterApp~FlitterApp
context module:libflitter/Context~Context
Returns:
Type
Promise.<void>

(async) load_jobs(sched, app, context) → {Promise.<void>}

Source:

Loads the job definition classes from files in this.directory and registers them with the scheduler.

Parameters:
Name Type Description
sched Agenda

the Agenda scheduler

app module:libflitter/app/FlitterApp~FlitterApp
context module:libflitter/Context~Context
Returns:
Type
Promise.<void>

name() → {string}

Source:
Overrides:

Returns the name of the AgendaUnit.

Returns:

"sched"

Type
string

templates() → {Object}

Source:

Returns the templates managed by the AgendaUnit.

Returns:
Type
Object