Skip to content

Create WebsocketTransport without connecting automatically #1457

@winstondu

Description

@winstondu

Feature request

Currently, the designated initializer for the WebSocketTransport immediately connects the websocket.

We wish to manually control when it does its first connection.

Motivation

We want to our app's webservers to able to handle load, and at high traffic times we actually want the ability to disable automatic websocket connections to our server at app startup.

Proposed solution

Add a parameter to the designated initializer on whether the websocket should connect immediately on initialization. In otherwords, wrap the websocket.connect() call in an if statement.

Additional notes:
Because the mutex-locked reconnect parameter only comes into play after the the first disconnection (which can only happen after the first connection), that parameter does not affect things.

Outstanding Questions

  • It is up to the implementor to decide whether there should be a separate api for the first websocket connection, or if the developer can just call reconnectWebSocket()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions