Class: LongPollingClient

LongPollingClient()

A client handling long polling a HTTP request.

Constructor

new LongPollingClient()

The constructor is for internal use. Use the factory methods instead.

Implements:
See:

Classes

LongPollingClient

Members

(readonly) isConnected :boolean

Returns whether the client is connected.

Type:
  • boolean
Implements:

(readonly) url :string

Returns the server URL.

Type:
  • string
Implements:

Methods

(async) close()

Closes the connection.

Implements:

(async) connect(url)

Connects to the server.

Parameters:
Name Type Description
url URL | string

The server URL to connect to.

Implements:

trackRequestSent() → {OutputTracker}

Returns a tracker for requests sent.

Returns:

A new output tracker.

Type
OutputTracker

(static) create(options) → {LongPollingClient}

Creates a long polling client.

Parameters:
Name Type Description
options object
Properties
Name Type Attributes Default Description
wait number <optional>
90000

The wait interval for a response.

retry number <optional>
1000

The retry interval after an error.

Returns:

A new long polling client.

Type
LongPollingClient

(static) createNull(options) → {LongPollingClient}

Creates a nulled long polling client.

Parameters:
Name Type Description
options object
Returns:

A new nulled long polling client.

Type
LongPollingClient