WebPubSubClientProtocol interface

The interface to be implemented for a web pubsub subprotocol

Properties

isReliableSubProtocol

True if the protocol supports reliable features

name

The name of subprotocol. Name will be used in websocket subprotocol

Methods

parseMessages(string | ArrayBuffer | Buffer)

Creates WebPubSubMessage objects from the specified serialized representation.

writeMessage(WebPubSubMessage)

Write WebPubSubMessage to string or ArrayBuffer

Property Details

isReliableSubProtocol

True if the protocol supports reliable features

isReliableSubProtocol: boolean

Property Value

boolean

name

The name of subprotocol. Name will be used in websocket subprotocol

name: string

Property Value

string

Method Details

parseMessages(string | ArrayBuffer | Buffer)

Creates WebPubSubMessage objects from the specified serialized representation.

function parseMessages(input: string | ArrayBuffer | Buffer): null | WebPubSubMessage | WebPubSubMessage[]

Parameters

input

string | ArrayBuffer | Buffer

The serialized representation

Returns

writeMessage(WebPubSubMessage)

Write WebPubSubMessage to string or ArrayBuffer

function writeMessage(message: WebPubSubMessage): string | ArrayBuffer

Parameters

message
WebPubSubMessage

The message to be written

Returns

string | ArrayBuffer