Gets a room reference by its unique identifier. The Rooms class ensures that only one reference exists for each room. A new reference object is created if it doesn't already exist, or if the one used previously was released using release(name).
Always call release(name)
after the Room object is no longer needed.
If a call to get
is made for a room that is currently being released, then the promise will resolve only when
the release operation is complete.
If a call to get
is made, followed by a subsequent call to release
before the promise resolves, then the
promise will reject with an error.
The unique identifier of the room.
Optional
options: RoomOptionsThe options for the room.
Room A promise to a new or existing Room object.
ErrorInfo if a room with the same name but different options already exists.
Release the Room object if it exists. This method only releases the reference to the Room object from the Rooms instance and detaches the room from Ably. It does not unsubscribe to any events.
After calling this function, the room object is no-longer usable. If you wish to get the room object again, you must call Rooms.get.
Calling this function will abort any in-progress get
calls for the same room.
The unique identifier of the room.
Manages the lifecycle of chat rooms.