phoenix-channel / ch.kuon.phoenix / Presence

Presence

class Presence

Listen for presence changes

Types

Entry

A presence entry

class Entry : JSONObject

Options

Presence options

class Options

Constructors

<init>

Listen for presence changes

Presence(channel: Channel, opts: Options = Options())

Properties

channel

A channel

val channel: Channel

opts

Options

val opts: Options

Functions

inPendingSyncState

Is there any pendinng sync state

fun inPendingSyncState(): Boolean

list

Returns the list of presence

fun list(by: (String, Entry) -> Entry = { _, p -> p }): List<Entry>

onJoin

Set the callback for join event

fun onJoin(callback: (key: String, currentPresence: Entry?, newPresence: Entry) -> Unit): Unit

onLeave

Set the callback for leave event

fun onLeave(callback: (key: String, currentPresence: Entry?, leftPresence: Entry) -> Unit): Unit

onSync

Set the callback for sync event

fun onSync(callback: () -> Unit): Unit