Class: Queue

Queue

Represents the queue of a room

Constructor

new Queue()

Properties:
Name Type Description
queue Array.<User> An ordered array of users being in the queue
Source:

Methods

addUser(userID) → {Promise}

Adds an user to the queue
Parameters:
Name Type Description
userID Number The id of the user to add
Source:
Returns:
Type
Promise

clear() → {Promise}

Clears and locks the queue
Source:
Returns:
Type
Promise

lock() → {Promise}

Locks the queue
Source:
Returns:
Type
Promise

moveUser(userID, position) → {Promise}

Moves an user in the queue
Parameters:
Name Type Description
userID Number The user to move
position Number The new position of the user
Source:
Returns:
Type
Promise

removeUser(userID) → {Promise}

Removes an user from the queue
Parameters:
Name Type Description
userID Number The id of the user to be removed
Source:
Returns:
Type
Promise

unlock() → {Promise}

Unlocks the queue
Source:
Returns:
Type
Promise