Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SharedSessionConnector

A connector to a shared session running inside a web worker

The messages coming from the shared worker be emitted as events on the stream.

Events emitted

connect_event the internal session's connect event

reconnect_event the internal session's reconnect event

disconnect_event the internal session's disconnect event

close_event the internal session's close event

error_event the internal session's error event

command_response a response from a command request has been received

Hierarchy

  • any
    • SharedSessionConnector

Index

Constructors

constructor

  • Parameters

    • sessionName: string
    • workerJs: string

    Returns SharedSessionConnector

Properties

Private emitter

emitter: Emitter

The emitter to emit stream events on

Private listener

listener: function

Type declaration

    • (command: string, ...messages: any[]): void
    • Parameters

      • command: string
      • Rest ...messages: any[]

      Returns void

Private router

The shared worker message router

Private sessionName

sessionName: string

The shared session name

Private worker

worker: SharedWorker

The shared worker containing the shared session

Methods

disconnect

  • disconnect(): void
  • Disconnect any listeners from the shared session

    Returns void

send

  • Send a message to the shared session inside the web worker

    Parameters

    Returns void

sendMessage

  • Send a message to the shared session

    Parameters

    Returns void