Home Reference Source Test Repository
public class | source

Scheduler

Scheduler

Test:

Constructor Summary

Public Constructor
public

constructor(params: Object)

Constructor

Member Summary

Public Members
public

Job class

public

Max number of jobs

public

Job list

public

Hubot robot object

public

key of Hubot brain

Method Summary

Public Methods
public

Cancel Job

public

Create new CronJob

public

Create new DateJob

public

Create Job id

public

createJob(params: Object): Job

Create new Job

public

Create new Job from brain

public

Initialize Hubot brain

public

Store Job to brain

public

Sync Jobs from Brain

public

updateJob(id: number, meta: Object)

Update existes Job

Public Constructors

public constructor(params: Object) source

Constructor

Params:

NameTypeAttributeDescription
params Object

params

params.robot Object

Hubot robot object

params.storeKey string

key of Hubot brain

params.job Object

Job class

params.jobMaxCount number
  • optional
  • default: 10000

max number of jobs

Test:

Public Members

public JobCls: Job source

Job class

public jobMaxCount: number source

Max number of jobs

public jobs: Object source

Job list

public robot: Object source

Hubot robot object

public storeKey: string source

key of Hubot brain

Public Methods

public cancelJob(id: number) source

Cancel Job

Params:

NameTypeAttributeDescription
id number

Job id

Test:

public createCronJob(params: Object): Job source

Create new CronJob

Params:

NameTypeAttributeDescription
params Object

params

params.pattern string

Cron pattern

params.user Object

Target Hubot user

params.meta Object

Data for using Job

params.id number

Job id

Return:

Job

public createDateJob(params: Object): Job source

Create new DateJob

Params:

NameTypeAttributeDescription
params Object

params

params.pattern string

Date string

params.user Object

Target Hubot user

params.meta Object

Data for using Job

params.id number

Job id

Return:

Job

public createId(): number source

Create Job id

Return:

number

public createJob(params: Object): Job source

Create new Job

Params:

NameTypeAttributeDescription
params Object

params

params.pattern string

Cron pattern or Date string

params.user Object

Target Hubot user

params.meta Object

data for using Job

params.id number
  • optional

Job id

Return:

Job

Test:

public createJobFromBrain(id: number, data: Object): Job source

Create new Job from brain

Params:

NameTypeAttributeDescription
id number

Job id

data Object

Date for Job

Return:

Job

public initBrain() source

Initialize Hubot brain

public storeJobToBrain(id: number, job: Job) source

Store Job to brain

Params:

NameTypeAttributeDescription
id number

Job id

job Job

Job

public syncBrain() source

Sync Jobs from Brain

Test:

public updateJob(id: number, meta: Object) source

Update existes Job

Params:

NameTypeAttributeDescription
id number

Job id

meta Object

Data for Job

Test: