subscribeFor

Subscribes to events of type T in the channel.


inline fun <T : ChatEvent> ChannelClient.subscribeFor(lifecycleOwner: LifecycleOwner, listener: ChatEventListener<T>): Disposable

Subscribes to events of type T in the channel, in the lifecycle of lifecycleOwner.

Only receives events when the lifecycle is in a STARTED state, otherwise events are dropped.


Subscribes to the specific eventTypes of the channel.


fun ChannelClient.subscribeFor(lifecycleOwner: LifecycleOwner, vararg eventTypes: KClass<out ChatEvent>, listener: ChatEventListener<ChatEvent>): Disposable

Subscribes to the specific eventTypes of the channel, in the lifecycle of lifecycleOwner.

Only receives events when the lifecycle is in a STARTED state, otherwise events are dropped.