Home Reference Source Test
public class | source

PrioritySynchronizer

Extends:

Observable → PrioritySynchronizer

Constructor Summary

Public Constructor
public

constructor(numPriorities: number, throttleAfter: number, throttleWait: number)

Member Summary

Public Members
public get

length: number

public get

totalElapsed: number

public get

totalJobs: number

public get

totalThrottles: number

public get

working: boolean

Method Summary

Public Methods
public

clear(): void

Reject all jobs in the queue and clear it.

public

push(priority: number, fn: function(): T): Promise<T>

Push function to the Synchronizer for later, synchronous execution

Inherited Summary

From class Observable
public static get

WILDCARD: string: string

public

bubble(observable: Observable, types: ...string)

public

fire(type: string, args: ...*): Promise

public

off(type: string, id: number)

public

on(type: string, callback: Function): number

Public Constructors

public constructor(numPriorities: number, throttleAfter: number, throttleWait: number) source

Override:

Observable#constructor

Params:

NameTypeAttributeDescription
numPriorities number
throttleAfter number
  • optional
  • nullable: true
throttleWait number
  • optional
  • nullable: true

Public Members

public get length: number source

public get totalElapsed: number source

public get totalJobs: number source

public get totalThrottles: number source

public get working: boolean source

Public Methods

public clear(): void source

Reject all jobs in the queue and clear it.

Return:

void

public push(priority: number, fn: function(): T): Promise<T> source

Push function to the Synchronizer for later, synchronous execution

Params:

NameTypeAttributeDescription
priority number

A discrete priority, 0 being highest.

fn function(): T

Function to be invoked later by this Synchronizer

Return:

Promise<T>