LiveQuerySubscription is returned by .live(). It exposes a coroutine Flow of notifications and a method to stop the subscription. See Live queries for the concept.
Source: surrealdb.kotlin
Members
id
The server-assigned live query ID.
Type: String
events
A flow of SurrealLiveNotification events for this subscription.
Type: Flow<SurrealLiveNotification>
.cancel()
Stops the subscription and kills the underlying live query on the server.
Returns: Unit
SurrealLiveNotification
The payload emitted on the events flow.
| Field | Type | Description |
|---|---|---|
action | String | The change kind: "CREATE", "UPDATE", or "DELETE". |
liveQueryId | String | The ID of the originating live query. |
result | JsonElement | The changed record or diff. |
Learn more
SurrealClient API reference for
.live()and.kill()