server: improve comments in streaming API

This commit is contained in:
Johann150 2023-03-19 11:09:56 +01:00
parent 806f757cc8
commit 7e4148880b
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -287,7 +287,11 @@ export class Connection {
} }
/** /**
* * Connect to a channel.
* @param id The ID that should be given to this newly created channel.
* @param params The parameters given for initializing this channel.
* @param channel The type of channel to connect to.
* @param pong `true` if a confirmation message should be sent back.
*/ */
public connectChannel(id: string, params: any, channel: string, pong = false) { public connectChannel(id: string, params: any, channel: string, pong = false) {
if (channels[channel].requireCredential && this.user == null) { if (channels[channel].requireCredential && this.user == null) {
@ -309,8 +313,8 @@ export class Connection {
} }
/** /**
* * Disconnect from a channel.
* @param id ID * @param id The unique ID of the channel to disconnect.
*/ */
public disconnectChannel(id: string) { public disconnectChannel(id: string) {
const channel = this.channels.find(c => c.id === id); const channel = this.channels.find(c => c.id === id);
@ -322,8 +326,8 @@ export class Connection {
} }
/** /**
* * Called when a message should be sent to a specific channel.
* @param data * @param data The message to be sent.
*/ */
private onChannelMessageRequested(data: any) { private onChannelMessageRequested(data: any) {
const channel = this.channels.find(c => c.id === data.id); const channel = this.channels.find(c => c.id === data.id);
@ -410,7 +414,7 @@ export class Connection {
} }
/** /**
* * Dispose all currently open channels where possible.
*/ */
public dispose() { public dispose() {
for (const c of this.channels.filter(c => c.dispose)) { for (const c of this.channels.filter(c => c.dispose)) {