AgendaClient

Hierarchy

Client

  • Client

    AgendaClient

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

+ new AgendaClient(props?: Props): AgendaClient

Inherited from Client.constructor

Overrides void

Parameters:

NameType
props?Props

Returns: AgendaClient

Properties

Readonly collectionName

collectionName: string


Readonly databaseName

databaseName: string


id

id: string | Guid

Overrides Client.id


Readonly mongoClient

mongoClient: MongoDBClient


Optional Readonly options

options? : Record‹string, any›


state

state: State

Implementation of Client.state

Overrides Client.state


Static STATES

STATES: object

Inherited from Client.STATES

Overrides void

Type declaration:

  • connected: string

  • constructed: string

  • disconnected: string

  • failed: string

  • initialized: string

  • paused: string

  • stopped: string

Accessors

library

get library(): Agenda

Gets library instance.

Returns: Agenda

Agenda instance.

Methods

connect

connect(): Promise‹void›

Implementation of Client

Connects to Agenda.

async

throws {Error} Thrown if Agenda client can't be instantiated.

Returns: Promise‹void›


disconnect

disconnect(): Promise‹void›

Implementation of Client

Disconnects Agenda client.

async

Returns: Promise‹void›


getId

getId(): string | Guid

Implementation of Client

Inherited from Client.getId

Overrides void

Returns: string | Guid


getInterval

getInterval(): number | undefined

Returns frequency at which client will query looking for jobs that need to be processed.

Returns: number | undefined

Interval for query frequency as a number, else undefined.


getSelectableStates

getSelectableStates(): Record‹string, State

Implementation of Client

Inherited from StatefulMixin.getSelectableStates

Overrides Task.getSelectableStates

Returns: Record‹string, State


getState

getState(): State

Implementation of Client

Inherited from StatefulMixin.getState

Overrides Task.getState

Returns: State


hasState

hasState(): boolean

Implementation of Client

Inherited from StatefulMixin.hasState

Overrides Task.hasState

Returns: boolean


initialize

initialize(): Promise‹void›

Implementation of Client

Initializes client.

async

Returns: Promise‹void›


isConnected

isConnected(): boolean

Implementation of Client

Evaluates if client is connected to Agenda.

Returns: boolean

Returns true if client is connected, else false.


isInOneOfStates

isInOneOfStates(states: State | State[]): boolean

Implementation of Client

Inherited from StatefulMixin.isInOneOfStates

Overrides Task.isInOneOfStates

Parameters:

NameType
statesState | State[]

Returns: boolean


isInState

isInState(state: State | State[]): boolean

Implementation of Client

Inherited from StatefulMixin.isInState

Overrides Task.isInState

Parameters:

NameType
stateState | State[]

Returns: boolean


reconnect

reconnect(): Promise‹void›

Implementation of Client

Reconnects Agenda.

async

Returns: Promise‹void›


setState

setState(state: State): void

Implementation of Client

Inherited from StatefulMixin.setState

Overrides Task.setState

Parameters:

NameType
stateState

Returns: void


stop

stop(): Promise‹void›

Stops Agenda client.

async

Returns: Promise‹void›


validateState

validateState(stateOrStates: State | State[], error?: Error): boolean

Implementation of Client

Inherited from StatefulMixin.validateState

Overrides Task.validateState

Parameters:

NameType
stateOrStatesState | State[]
error?Error

Returns: boolean