Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "lib/D4C"

Index

Functions

QConcurrency

  • QConcurrency(queuesParam: Array<{ isStatic?: boolean; limit: number; tag?: string | symbol }>): ClassDecorator
  • Class decorator to setup concurrency for queues

    Parameters

    • queuesParam: Array<{ isStatic?: boolean; limit: number; tag?: string | symbol }>

      a array of each queue parameter

    Returns ClassDecorator

concurrent

  • concurrent(target: any, propertyKey: string, descriptor: PropertyDescriptor): void
  • concurrent(option?: { dropWhenReachLimit?: boolean; inheritPreErr?: boolean; noBlockCurr?: boolean; tag?: string | symbol }): MethodDecoratorType
  • Static and instance method decorator. Default concurrency = Infinity. usage example:

    @concurrent
    async fetchData() {}
    // or
    @concurrent({ tag: 'world', inheritPreErr: true, noBlockCurr: true })
    static async fetchData(url: string) {}
    

    Parameters

    • target: any
    • propertyKey: string
    • descriptor: PropertyDescriptor

    Returns void

  • Parameters

    • Optional option: { dropWhenReachLimit?: boolean; inheritPreErr?: boolean; noBlockCurr?: boolean; tag?: string | symbol }
      • Optional dropWhenReachLimit?: boolean
      • Optional inheritPreErr?: boolean
      • Optional noBlockCurr?: boolean
      • Optional tag?: string | symbol

    Returns MethodDecoratorType

synchronized

  • synchronized(target: any, propertyKey: string, descriptor: PropertyDescriptor): void
  • synchronized(option?: { inheritPreErr?: boolean; noBlockCurr?: boolean; tag?: string | symbol }): MethodDecoratorType
  • Static and instance method decorator. Default concurrency = 1 for lock. usage example:

    @synchronize
    async connect() {}
    // or
    @synchronized({ tag: 'world', inheritPreErr: true, noBlockCurr: true })
    static async staticMethod(text: string) {}
    

    Parameters

    • target: any
    • propertyKey: string
    • descriptor: PropertyDescriptor

    Returns void

  • Parameters

    • Optional option: { inheritPreErr?: boolean; noBlockCurr?: boolean; tag?: string | symbol }
      • Optional inheritPreErr?: boolean
      • Optional noBlockCurr?: boolean
      • Optional tag?: string | symbol

    Returns MethodDecoratorType

Generated using TypeDoc