Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DelayStrategy

This is the interface for classes that represent a delay strategy. DelayStrategy objects are used by the client in order to determine a delay period between reconnection attempts. AMPS provides FixedDelayStrategy and ExponentialDelayStrategy classes that implement basic functionality to calculate delay intervals with fixed or exponentially growing values.

Hierarchy

  • DelayStrategy

Implemented by

Index

Methods

getConnectWaitDuration

  • getConnectWaitDuration(uri: string): number
  • This method returns the time (in milliseconds) that the client should delay before connecting to the given server URI.

    Parameters

    • uri: string

      The URI of the server.

    Returns number

    the time (in milliseconds) that the client should delay.

reset

  • reset(): void
  • This method resets the state of this reconnect delay. AMPS calls this method when a connection is established.

    Returns void