Home Manual Reference Source
public class | source

JobMonitor

Used for monitoring the job queue

Constructor Summary

Public Constructor
public

constructor(api: Maps4News, maxRows: number, longPoll: boolean)

JobMonitor constructor

Member Summary

Public Members
public get

Get api instance

public get

Contains the current JobMonitor data

public set

Set the filter for the job monitor

public get

get the filter for the job monitor

public set
public get
public set

If internal users should be hidden.

public get

If internal users should be hidden in the data

public get

Returns the time the ::update method was called for the last time.

public get

Get if long polling should be used

public set

longPoll(value: boolean)

Set if long polling should be used

public get

Maximum number of rows to store

public set

maxRows(value: number)

Set the maximum number of rows to store.

public get

Used to get internal reference max rows

public get

If the JobMonitor is waiting for data.

Method Summary

Public Methods
public

Update maxRows and run update()

public

update(allowLongPoll: Boolean): Promise<Number>

Update the job list

Public Constructors

public constructor(api: Maps4News, maxRows: number, longPoll: boolean) source

JobMonitor constructor

Params:

NameTypeAttributeDescription
api Maps4News

Api instance

maxRows number
  • optional
  • default: 100

Default maximum amount of rows

longPoll boolean
  • optional
  • default: true

Use long-polling instead of regular poling

Public Members

public get api: Maps4News: * source

Get api instance

Return:

Maps4News

Api instance

public get data: Array<JobMonitorRow>: * source

Contains the current JobMonitor data

Return:

Array<JobMonitorRow>

Job monitor rows

public set filterStatus(value: string) source

Set the filter for the job monitor

See:

public get filterStatus: string: * source

get the filter for the job monitor

Return:

string

Job monitor filter

public set filterTags source

public get filterTags: * source

public set hideInternal(value: boolean) source

If internal users should be hidden. Updating this value won't take effect until the JobMonitor#update method has been called.

public get hideInternal: boolean: * source

If internal users should be hidden in the data

Return:

boolean

hide internal users

public get lastUpdate: Date: * source

Returns the time the ::update method was called for the last time.

Return:

Date

Last update

Throw:

update

public get longPoll: boolean: * source

Get if long polling should be used

Return:

boolean

If long polling should be used

public set longPoll(value: boolean) source

Set if long polling should be used

public get maxRows: number: * source

Maximum number of rows to store

Return:

number

Maximum number of rows

public set maxRows(value: number) source

Set the maximum number of rows to store. Updating this value won't take effect until the JobMonitor#update method has been called.

public get realMaxRows: * source

Used to get internal reference max rows

public get waiting: Boolean: * source

If the JobMonitor is waiting for data. Any update request will resolve with false instantly while this is true.

Return:

Boolean

Waiting for data

Public Methods

public loadMore(count: number): Promise<Number> source

Update maxRows and run update()

Params:

NameTypeAttributeDescription
count number
  • optional
  • default: 50

Amount to increase maxRows by

Return:

Promise<Number>

number of updated rows

Throw:

ApiError

public update(allowLongPoll: Boolean): Promise<Number> source

Update the job list

Params:

NameTypeAttributeDescription
allowLongPoll Boolean
  • optional
  • default: true

If long polling is allowed

Return:

Promise<Number>

number of updated rows

Throw:

ApiError

TODO:

  • refactor