broadcastFlow

inline fun <T : Any> RealtimeChannel.broadcastFlow(event: String): Flow<T>(source)

Broadcasts can be messages sent by other clients within the same channel under a specific event.

Example:

val messageFlow = channel.broadcastFlow<Message>("message")
messageFlow.collect {
println("Received message: $it")
}

Parameters

event

When a message is sent by another client, it will be sent under a specific event. This is the event that you want to listen to