chore(browser): comments

This commit is contained in:
karishmas6
2024-06-01 00:25:02 +05:30
parent 6731ae6c25
commit c7f0bfa7bc

View File

@@ -1,6 +1,13 @@
import {Namespace, Socket} from 'socket.io';
import logger from "../logger";
/**
* Opens a websocket canal for duplex data transfer and registers all handlers for this data for the recording session.
* Uses socket.io dynamic namespaces for multiplexing the traffic from different running remote browser instances.
* @param io dynamic namespace on the socket.io server
* @param callback function called after the connection is created providing the socket resource
* @category BrowserManagement
*/
export const createSocketConnection = (
io: Namespace,
callback: (socket: Socket) => void,
@@ -14,6 +21,13 @@ export const createSocketConnection = (
io.on('connection', onConnection);
};
/**
* Opens a websocket canal for duplex data transfer for the recording run.
* Uses socket.io dynamic namespaces for multiplexing the traffic from different running remote browser instances.
* @param io dynamic namespace on the socket.io server
* @param callback function called after the connection is created providing the socket resource
* @category BrowserManagement
*/
export const createSocketConnectionForRun = (
io: Namespace,
callback: (socket: Socket) => void,