Home Manual Reference Source Test
import {IBackoffStrategy} from 'influx'
public interface | source

IBackoffStrategy

Direct Implemented:

The IBackoffStrategy dictates behaviour to use when hosts in the connection pool start failing. We remove them from the pool for a duration of time specified by the backoff strategy.

The strategy itself is immutable, and each method call should return a new strategy without modifying the original one.

Example:

let backoff = new MyBackoffStrategy();
console.log(backoff.getDelay()); // => 10
backoff = backoff.next();
console.log(backoff.getDelay()); // => 20
backoff = backoff.reset();
console.log(backoff.getDelay()); // => 10

Method Summary

Public Methods
public

getDelay returns the amount of delay of the current backoff.

public

Next is called when a failure occurs on a host to return the next backoff amount.

public

Returns a strategy with a reset backoff counter.

Public Methods

public getDelay(): Number source

getDelay returns the amount of delay of the current backoff.

Return:

Number

public next(): IBackoffStrategy source

Next is called when a failure occurs on a host to return the next backoff amount.

public reset(): IBackoffStrategy source

Returns a strategy with a reset backoff counter.