Room module¶
-
class
entities.ent_room.
Room
(name, max_user, room_id: Optional[str] = None)¶ Bases:
object
Class of Room in server
-
add
(user: entities.ent_user.User) → bool¶ Add a new user in room
- Parameters
user – user who wants to join
- Returns
result of insertion
-
broadcast
(message, user) → None¶ Send the message to all users in this room (broadcast)
:param message:message to be send :param user: user who sent this message
- Returns
None
-
remove
(user: entities.ent_user.User) → bool¶ Remove an user of room
- Parameters
user – user who wants to leave room
- Returns
result of insertion
-
to_dto
() → dtos.dto_room.Room¶ Convert room to dto
- Returns
dto obj
-