Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
GitHub
t

LifecycleObserver

trait LifecycleObserver

Receives structured operational events from LiveView lifecycles.

Observers run synchronously and should not block. Scalive isolates observer failures from the observed lifecycle, but a slow observer can still delay it. Structured fields deliberately exclude models, messages, browser payloads, credentials, and session claims. Application-thrown exception causes may contain application data and require the same handling as application logs.

Defined by scalive.LifecycleObserver. View source (scalive/api/src/scalive/LifecycleObserver.scala:13-26)

Methods2

andThen

def andThen(that: LifecycleObserver): LifecycleObserver

Sends each event to this observer and then that observer.

Defined by scalive.LifecycleObserver.andThen. View source (scalive/api/src/scalive/LifecycleObserver.scala:22-23)

observe

def observe(event: LifecycleEvent): zio.package.UIO[Unit]

Handles one event.

Scalive waits for the returned effect and ignores its failures, so keep it fast and hand slow work such as network export to a bounded queue.

Defined by scalive.LifecycleObserver.observe. View source (scalive/api/src/scalive/LifecycleObserver.scala:19-19)