How to use rx-queue - 7 common examples

To help you get started, we’ve selected a few rx-queue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github huan / rx-queue / tests / fixtures / smoke-testing.ts View on Github external
RxQueue,
  ThrottleQueue,
  VERSION,
}                 from 'rx-queue'

if (VERSION === '0.0.0') {
  throw new Error('version should be set before publishing')
}

const rq = new RxQueue()
console.info(`RxQueue v${rq.version()}`)

const dq = new DelayQueue()
console.info(`DelayQueue v${dq.version()}`)

const tq = new ThrottleQueue()
console.info(`ThrottleQueue v${tq.version()}`)

console.info('Smoke Testing PASSED!')
github huan / rx-queue / tests / fixtures / smoke-testing.ts View on Github external
import {
  DelayQueue,
  RxQueue,
  ThrottleQueue,
  VERSION,
}                 from 'rx-queue'

if (VERSION === '0.0.0') {
  throw new Error('version should be set before publishing')
}

const rq = new RxQueue()
console.info(`RxQueue v${rq.version()}`)

const dq = new DelayQueue()
console.info(`DelayQueue v${dq.version()}`)

const tq = new ThrottleQueue()
console.info(`ThrottleQueue v${tq.version()}`)

console.info('Smoke Testing PASSED!')
github huan / rx-queue / tests / fixtures / smoke-testing.ts View on Github external
import {
  DelayQueue,
  RxQueue,
  ThrottleQueue,
  VERSION,
}                 from 'rx-queue'

if (VERSION === '0.0.0') {
  throw new Error('version should be set before publishing')
}

const rq = new RxQueue()
console.info(`RxQueue v${rq.version()}`)

const dq = new DelayQueue()
console.info(`DelayQueue v${dq.version()}`)

const tq = new ThrottleQueue()
console.info(`ThrottleQueue v${tq.version()}`)

console.info('Smoke Testing PASSED!')
github wechaty / wechaty / src / puppet-padchat / padchat-rpc.ts View on Github external
/**
     * Throttle for 10 seconds
     */
    this.throttleQueue = new ThrottleQueue(1000 * 10)
    /**
     * Debounce for 20 seconds
     */
    this.debounceQueue = new DebounceQueue(1000 * 10 * 2)

    /**
     * Throttle for 5 seconds for the `logout` event:
     *  we should only fire once for logout,
     *  but the server will send many events of 'logout'
     */
    this.logoutThrottleQueue = new ThrottleQueue(1000 * 5)

    this.initHeartbeat()

    if (this.logoutThrottleSubscription) {
      throw new Error('this.logoutThrottleSubscription exist')
    } else {
      this.logoutThrottleSubscription = this.logoutThrottleQueue.subscribe(async msg => {
        await this.reset(msg)
      })
    }
  }
github wechaty / wechaty / src / puppet-padchat / padchat-rpc.ts View on Github external
private startQueues() {
    log.verbose('PadchatRpc', 'startQueues()')

    /**
     * Throttle for 10 seconds
     */
    this.throttleQueue = new ThrottleQueue(1000 * 10)
    /**
     * Debounce for 20 seconds
     */
    this.debounceQueue = new DebounceQueue(1000 * 10 * 2)

    /**
     * Throttle for 5 seconds for the `logout` event:
     *  we should only fire once for logout,
     *  but the server will send many events of 'logout'
     */
    this.logoutThrottleQueue = new ThrottleQueue(1000 * 5)

    this.initHeartbeat()

    if (this.logoutThrottleSubscription) {
      throw new Error('this.logoutThrottleSubscription exist')
github wechaty / wechaty / src / puppet-padchat / padchat-rpc.ts View on Github external
private startQueues() {
    log.verbose('PadchatRpc', 'startQueues()')

    /**
     * Throttle for 10 seconds
     */
    this.throttleQueue = new ThrottleQueue(1000 * 10)
    /**
     * Debounce for 20 seconds
     */
    this.debounceQueue = new DebounceQueue(1000 * 10 * 2)

    /**
     * Throttle for 5 seconds for the `logout` event:
     *  we should only fire once for logout,
     *  but the server will send many events of 'logout'
     */
    this.logoutThrottleQueue = new ThrottleQueue(1000 * 5)

    this.initHeartbeat()

    if (this.logoutThrottleSubscription) {
      throw new Error('this.logoutThrottleSubscription exist')
    } else {
      this.logoutThrottleSubscription = this.logoutThrottleQueue.subscribe(async msg => {
        await this.reset(msg)
      })
github wechaty / wechaty / src / puppet-padchat / padchat-manager.ts View on Github external
public options: ManagerOptions,
  ) {
    super(options.endpoint, options.token)
    log.verbose('PuppetPadchatManager', 'constructor()')

    this.memorySlot = {
      device: {},
    }

    this.state = new StateSwitch('PuppetPadchatManager')

    /**
     * Executer Queue: execute one task at a time,
     *  delay between them for 15 second
     */
    this.delayQueueExecutor = new DelayQueueExector(1000 * 15)

  }

rx-queue

Easy to Use ReactiveX Queue that Supports Delay/DelayExecutor/Throttle/Debounce/Concurrency Features Powered by RxJS/IxJS

Apache-2.0
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis