Room

interface Room : Discontinuity

Represents a chat room.

Types

Link copied to clipboard
fun interface Listener

An interface for listening to changes for the room status

Properties

Link copied to clipboard
abstract val channel: RealtimeChannel

Get the underlying Ably realtime channel used for the room.

Link copied to clipboard
abstract val error: ErrorInfo?

The current error, if any, that caused the room to enter the current status.

Link copied to clipboard
abstract val messages: Messages

Allows you to send, subscribe-to and query messages in the room.

Link copied to clipboard
abstract val occupancy: Occupancy

Allows you to interact with occupancy metrics for the room.

Link copied to clipboard
abstract val options: RoomOptions

Returns the room options.

Link copied to clipboard
abstract val presence: Presence

Allows you to subscribe to presence events in the room.

Link copied to clipboard
abstract val reactions: RoomReactions

Allows you to interact with room-level reactions.

Link copied to clipboard
abstract val roomId: String

The unique identifier of the room.

Link copied to clipboard
abstract val status: RoomStatus

(CHA-RS2) The current status of the room.

Link copied to clipboard
abstract val typing: Typing

Allows you to interact with typing events in the room.

Functions

Link copied to clipboard
abstract suspend fun attach()

Attaches to the room to receive events in realtime.

Link copied to clipboard
abstract suspend fun detach()

Detaches from the room to stop receiving events in realtime.

Link copied to clipboard
fun Discontinuity.discontinuityAsFlow(): Flow<ErrorInfo>
Link copied to clipboard

Register a listener to be called when a discontinuity is detected.

Link copied to clipboard
abstract fun onStatusChange(listener: Room.Listener): Subscription

Registers a listener that will be called whenever the room status changes.

Link copied to clipboard