Class RespondToWaiting

Handles the response to a participant in the waiting room, either allowing or denying their entry.

Options for handling the participant's entry request.

Unique identifier for the participant.

Name of the participant.

Function to update the waiting list by removing the responded participant.

Current list of participants in the waiting room.

Indicates whether to allow ("true") or deny ("false") the participant's entry.

The name of the room the participant is requesting to join.

The socket instance used to emit the response event.

Resolves when the response has been processed.

const respondService = new RespondToWaiting();
respondService.respondToWaiting({
participantId: '12345',
participantName: 'John Doe',
updateWaitingList: (newList) => console.log('Updated Waiting List:', newList),
waitingList: currentWaitingList,
type: 'true',
roomName: 'Room1',
socket: io('http://localhost:3000'),
});

In this example, the participant 'John Doe' is allowed to join 'Room1', and the updated waiting list is logged.

Constructors

Methods

Constructors

Methods