@tinkoff/request

@tinkoff/request

  • How to
  • Plugins
  • Internals
  • GitHub

›Plugins

Core

  • Core
  • Context
  • Request execution
  • Plugin

Plugins

  • Plugins
  • Batch
  • Cache - Deduplicate
  • Cache - Fallback
  • Cache - Memory
  • Cache - Etag
  • Cache - Persistent
  • Log
  • Protocol - Http
  • Protocol - Jsonp
  • Transform - Url
  • Validate
  • Circuit Breaker
  • Prom RED metrics
  • Retry

How to

  • How to

Retry Plugin

Retries failed requests

Parameters

Create options

  • retry: number [=0] - number of attempts to execute failed request
  • retryDelay: number | Function [=100] - time in ms to wait before execute new attempt
  • maxTimeout: number [=60000] - final timeout for complete request including retry attempts

Request params

  • retry: number - number of attempts to execute failed request
  • retryDelay: number | Function - time in ms to wait before execute new attempt

External meta

  • retry.attempts: number - request start Date.now()

Example

import request from '@tinkoff/request-core';
import retry from '@tinkoff/request-plugin-retry';

const req = request([
    // .. cache plugin and other plugins for transform request
    retry({ retry: 3, retryDelay: 500 }),
    // ...other plugins to make actual request and validate it
]);
← Prom RED metricsHow to →
  • Parameters
    • Create options
    • Request params
    • External meta
  • Example
Copyright © 2023 tinkoff.ru