import { RealtimeClient } from "https://deno.land/x/realtime@1.2.0/src/index.ts";
Properties
Methods
private
_appendParams(url: string, params: { [key: string]: string; })private
_flushSendBuffer()private
_onConnClose(event: any)private
_onConnError(error: Event | ErrorEvent)private
_onConnOpen()private
_resetHeartbeat()private
_sendHeartbeat()private
_triggerChanError()channel(topic: string, chanParams?)
connect()
Connects the socket.
Returns the current state of the socket.
disconnect(code?: number, reason?: string): Promise<{ error: Error | null; data: boolean; }>
Disconnects the socket.
Returns the URL of the websocket.
Retuns true
is the connection is open.
log()
kind: string,
msg: string,
data?: any,
Logs the message. Override this.logger
for specialized logging.
makeRef()
Return the next message ref, accounting for overflows
onClose(callback: Function)
Registers a callbacks for connection state change events.
onConnMessage(rawMessage: any)
onError(callback: Function)
Registers a callback for connection state change events.
onMessage(callback: Function)
Calls a function any time a message is received.
onOpen(callback: Function)
Registers a callback for connection state change event.
push(data: Message)
remove(channel: RealtimeSubscription)
Removes a subscription from the socket.