drashland/wocket

Auto-reconnect

player-4 opened this issue · 3 comments

Think about more options/config for client and server classes (i.e. redis, ping intervals, ping timeouts, path, etc)

Only stuff i can think of is the following (which is mostly what you've said):

// pseudo code, relating to the server class
interface ServerConfigs {
  host/address?: string,
  port?: number
}
...
  private configs: ServerConfigs = {
    host/address: 'the default addr',
    port: the default port
  }

  constructor (configs: ServerConfigs) {
    if (configs.host/address) this.configs.host/address = configs....
    if (configs.port) this.configs.port = configs.port
  } 

Regarding Redis, i can only think of:

// pseudo code again
{
  host: string,
  port: number
  channelListeningOn: string || channelsListeningOn: string[]
  connection: any // maybe not required?
  pubSub: any = connection.pubSub
}

Yeah, sorry a lot going on lately, but I've renamed this so it is more targeted. We need an auto-reconnect feature. A pingInterval and pingTimeout interval that can be set in options so we can keep the session alive.

Going to aim to update docs and make a simple website for the sockets over the weekend.

thought: we can add ping and pong to the RESERVED_EVENT_NAMES file