feat(browser): socket connection for run
This commit is contained in:
@@ -14,3 +14,15 @@ export const createSocketConnection = (
|
|||||||
io.on('connection', onConnection);
|
io.on('connection', onConnection);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const createSocketConnectionForRun = (
|
||||||
|
io: Namespace,
|
||||||
|
callback: (socket: Socket) => void,
|
||||||
|
) => {
|
||||||
|
const onConnection = async (socket: Socket) => {
|
||||||
|
logger.log('info',"Client connected " + socket.id);
|
||||||
|
socket.on('disconnect', () => logger.log('info', "Client disconnected " + socket.id));
|
||||||
|
callback(socket);
|
||||||
|
}
|
||||||
|
|
||||||
|
io.on('connection', onConnection);
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user