Skip to content

channel

//fluxbase-kotlin/io.github.nimbleflux.fluxbase/FluxbaseClient/channel

[jvm]
fun channel(name: String, transport: WebSocketTransport? = null): RealtimeChannel

Create a realtime channel for postgres_changes/broadcast/presence subscriptions. Port of channel() in client.ts:654-674.

Usage:

val channel = client.channel("public:trips")
channel.on("INSERT", PostgresChangesConfig(table = "trips")) { payload -> ... }
channel.subscribe()