How to use @wireapp/priority-queue - 1 common examples

To help you get started, we’ve selected a few @wireapp/priority-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 wireapp / wire-web-packages / packages / api-client / src / http / HttpClient.ts View on Github external
constructor(private readonly baseUrl: string, public accessTokenStore: AccessTokenStore) {
    super();

    this.connectionState = ConnectionState.UNDEFINED;

    this.logger = logdown('@wireapp/api-client/http/HttpClient', {
      logger: console,
      markdown: false,
    });

    this.requestQueue = new PriorityQueue({
      maxRetries: 0,
      retryDelay: TimeUtil.TimeInMillis.SECOND,
    });

    // Log all failing HTTP requests
    axios.interceptors.response.use(undefined, (error: AxiosError) => {
      let backendResponse = '';

      if (error.response) {
        try {
          backendResponse = JSON.stringify(error.response.data);
        } finally {
          this.logger.error(
            `HTTP Error (${error.response.status}) on '${error.response.config.url}': ${error.message} (${backendResponse})`,
          );
        }

@wireapp/priority-queue

A Promise-based dynamic priority queue runner.

GPL-3.0
Latest version published 2 months ago

Package Health Score

63 / 100
Full package analysis

Popular @wireapp/priority-queue functions