new exports(topic, params, socket)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
topic |
string | |
params |
Object | function | |
socket |
Socket |
| Name | Type | Description |
|---|---|---|
topic |
string | |
params |
Object | function | |
socket |
Socket |
Initializes the Presence
| Name | Type | Description |
|---|---|---|
channel |
Channel | The Channel |
opts |
Object | The options,
for example |
Initializes the Push
| Name | Type | Description |
|---|---|---|
channel |
Channel | The Channel |
event |
string | The event, for example |
payload |
Object | The payload, for example |
timeout |
number | The push timeout in milliseconds |
Initializes the Socket *
For IE8 support use an ES5-shim (https://github.com/es-shims/es5-shim)
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
endPoint |
string | The string WebSocket endpoint, ie, |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
Optional configuration Properties
|
Creates a timer that accepts a timerCalc function to perform
calculated timeout retries, such as exponential backoff.
let reconnectTimer = new Timer(() => this.connect(), function(tries){
return [1000, 5000, 10000][tries - 1] || 10000
})
reconnectTimer.scheduleTimeout() // fires after 1000
reconnectTimer.scheduleTimeout() // fires after 5000
reconnectTimer.reset()
reconnectTimer.scheduleTimeout() // fires after 1000
| Name | Type | Description |
|---|---|---|
callback |
function | |
timerCalc |
function |