Skip to content

Commit

Permalink
chore: interface update
Browse files Browse the repository at this point in the history
- make ErrorReason on the channel nullable
- improve docstrings
  • Loading branch information
ttypic committed Feb 12, 2025
1 parent 18a5020 commit 2f7661d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion pubsub-adapter/src/main/kotlin/com/ably/pubsub/Channel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,40 @@ import com.ably.query.OrderBy
import io.ably.lib.types.*

/**
* An interface representing a Channel in the Ably API.
* An interface representing a Channel in the Ably API. This serves as the base interface
* for both [RealtimeChannel] and [RestChannel], providing common channel functionality
* such as history retrieval and presence management.
*
* A channel is the medium through which messages are distributed. Channels can represent
* different topics, rooms, or contexts in your application.
*
* @see <a href="https://ably.com/docs/realtime/channels">Ably Channels Documentation</a>
*/
interface Channel {

/**
* The channel name.
*
* Channel names:
* - Can contain any Unicode characters except colon (':')
* - Are limited to 250 characters
* - Are case-sensitive
*
* @see <a href="https://ably.com/docs/realtime/channels#channel-naming">Channel Naming Rules</a>
*/
val name: String

/**
* A [Presence] object.
*
* The Presence object enables clients to be notified when other clients enter or leave
* the channel (presence events) and get the set of current members on the channel
* (presence state).
*
* Common use cases include:
* - Online status indicators
* - Typing indicators
* - User activity tracking
*
* Spec: RTL9
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface RealtimeChannel : Channel {
*
* Spec: RTL4e
*/
val reason: ErrorInfo
val reason: ErrorInfo?

/**
* A [ChannelProperties] object.
Expand Down

0 comments on commit 2f7661d

Please sign in to comment.