Channel

class Channel(key: String) : Attachable

Constructors

Link copied to clipboard
constructor(key: String)

Properties

Link copied to clipboard
val eventStream: SharedFlow<ChannelEvent>

Functions

Link copied to clipboard
open override fun applyStatus(status: ResourceStatus)

applyStatus applies the channel status into this channel counter.

Link copied to clipboard
fun close()

close cancels the internal coroutine scope.

Link copied to clipboard

getActorID returns the actor ID of this channel counter.

Link copied to clipboard
fun getCount(): Long

getCount returns the current online session count value.

Link copied to clipboard
open override fun getKey(): String

getKey returns the key of this channel counter.

Link copied to clipboard

getSessionCount returns the current online session count value.

Link copied to clipboard

getSessionId returns the session ID from the server.

Link copied to clipboard
open override fun getStatus(): ResourceStatus

getStatus returns the status of this channel counter.

Link copied to clipboard
open override fun hasLocalChanges(): Boolean

hasLocalChanges returns whether this channel has local changes or not. Channel is server-managed, so it always returns false.

Link copied to clipboard

isAttached returns whether this channel counter is attached or not.

Link copied to clipboard
open override fun publish(event: ResourceEvent)

publish publishes an event to all registered handlers.

Link copied to clipboard
open override fun setActor(actorID: String)

setActor sets the actor ID into this channel counter.

Link copied to clipboard
fun setSessionId(sessionId: String?)

setSessionId sets the session ID from the server, or clears it with null so the next refresh runs as a first call. SDK-internal use.

Link copied to clipboard
fun updateCount(count: Long, seq: Long): Boolean

updateCount updates the session count and sequence number if the sequence is newer. Returns true if the session count was updated, false if the update was ignored.

Link copied to clipboard
fun updateSessionCount(sessionCount: Long, seq: Long): Boolean

updateSessionCount updates the session count and sequence number if the sequence is newer. Returns true if the session count was updated, false if the update was ignored.