File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
chat-android/src/main/java/com/ably/chat Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ interface ChatClient {
1212 /* *
1313 * The rooms object, which provides access to chat rooms.
1414 */
15- val room : Room
15+ val rooms : Rooms
1616
1717 /* *
1818 * The underlying connection to Ably, which can be used to monitor the clients
Original file line number Diff line number Diff line change 1+ package com.ably.chat
2+
3+ /* *
4+ * Manages the lifecycle of chat rooms.
5+ */
6+ interface Rooms {
7+ /* *
8+ * Get the client options used to create the Chat instance.
9+ */
10+ val clientOptions: ClientOptions
11+
12+ /* *
13+ * Gets a room reference by ID. The Rooms class ensures that only one reference
14+ * exists for each room. A new reference object is created if it doesn't already
15+ * exist, or if the one used previously was released using release(roomId).
16+ *
17+ * Always call `release(roomId)` after the Room object is no longer needed.
18+ *
19+ * @param roomId The ID of the room.
20+ * @param options The options for the room.
21+ * @throws {@link ErrorInfo} if a room with the same ID but different options already exists.
22+ * @returns Room A new or existing Room object.
23+ */
24+ fun get (roomId : String , options : RoomOptions ): Room
25+
26+ /* *
27+ * Release the Room object if it exists. This method only releases the reference
28+ * to the Room object from the Rooms instance and detaches the room from Ably. It does not unsubscribe to any
29+ * events.
30+ *
31+ * After calling this function, the room object is no-longer usable. If you wish to get the room object again,
32+ * you must call {@link Rooms.get}.
33+ *
34+ * @param roomId The ID of the room.
35+ */
36+ suspend fun release (roomId : String )
37+ }
You can’t perform that action at this time.
0 commit comments