Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
c

ConnectedLifecycleContext

class ConnectedLifecycleContext(connectionId: Long, lifecycleId: Long)

Coordinates one connected LiveView lifecycle without exposing application or protocol data.

Parameters

connectionId

The ID of the WebSocket connection. Root and nested LiveViews joined over the same WebSocket share it, and a reconnect gets a new one.

lifecycleId

The ID of the LiveView lifecycle, unique on its connection. A LiveView's first connected lifecycle on a connection reuses the ID issued by its disconnected render, so the ID stays the same across reconnects; combine it with connectionId to tell connections apart. A rejoin after a crash and a LiveView reached by live navigation get a new ID.

Defined by scalive.ConnectedLifecycleContext. View source (scalive/api/src/scalive/LifecycleObserver.scala:49-51)

Values2

connectionId

val connectionId: Long

The ID of the WebSocket connection. Root and nested LiveViews joined over the same WebSocket share it, and a reconnect gets a new one.

Defined by scalive.ConnectedLifecycleContext.connectionId. View source (scalive/api/src/scalive/LifecycleObserver.scala:50-50)

lifecycleId

val lifecycleId: Long

The ID of the LiveView lifecycle, unique on its connection. A LiveView's first connected lifecycle on a connection reuses the ID issued by its disconnected render, so the ID stays the same across reconnects; combine it with connectionId to tell connections apart. A rejoin after a crash and a LiveView reached by live navigation get a new ID.

Defined by scalive.ConnectedLifecycleContext.lifecycleId. View source (scalive/api/src/scalive/LifecycleObserver.scala:51-51)