Class LockJob<TResult>

Class that represents one scheduled job and its state. This is created every time user calls "acquire"

Type Parameters

  • TResult

Hierarchy

  • LockJob

Constructors

Properties

callback: ICallback<TResult>

Function that will be called once job is done, whether it succeeds or times out. This is supplied by user in callback API, and generated internally otherwise.

ended_at: Date = null

This is set when job ends, in case something holds a reference to it

enqueued_at: Date = ...

Timestamp when job was created

executed_at: Date = null

Timestamp when job was executed

execution_timeout_id: any = null

Id of the execution timer

executor: BetterLockExecutor<TResult>

Function that will be called inside the lock

id: any = undefined

ID to uniquely identify this particular job

incoming_stack: string = null

Saved incoming stack, for the purpose of extending stack traces

keys: string[]

List of keys that will be locked. Always an array

Options that apply to this particular job

wait_timeout_id: any = null

Id of the wait timer

waiting_count: number

Number of keys which this job is waiting on. Once this reaches 0, job will be executed

_lastId: number = 0

Methods

  • toString(): string
  • Returns string

Generated using TypeDoc