Session Lifecycle
Sessions progress through these states:
Session Event Types
| Event Type | Pattern | Description |
session.status | Query | Retrieve current session status and metadata |
session.validate | Request-Response | Validate session health and configuration |
session.get | Request-Response | Retrieve specific session information |
session.modify | Request-Response | Modify session configuration |
session.update | Request-Response | Update session state |
session.read | Direct | Read pending events from session queue |
session.destroy | Request-Response | Terminate session and free resources |
session.status
Query the current status and metadata of an active session.
session.validate
Validate that a session is properly configured and healthy.
type: session.validate
event_data: {}
session.get
Retrieve specific session configuration or state information.
type: session.get
event_data:
# Parameters are lens-specific
session.modify
Modify session configuration or parameters while the session is running.
type: session.modify
event_data:
# Parameters are lens-specific
session.update
Update session state or trigger session processing.
type: session.update
event_data:
# Parameters are lens-specific
session.read
Read pending events from the session’s event queue.
Unlike other session events, session.read returns immediately without waiting for a response.
type: session.read
event_data:
# Parameters are lens-specific
session.destroy
Terminate an active session and free its allocated resources.
Only affects sessions in SESSION_STATUS_STARTING or SESSION_STATUS_RUNNING status.
type: session.destroy
event_data: {}
Error Responses
| Error Type | Message | Cause |
error | "Unknown session id: {session_id}" | Session not found |
error | "Failed to fetch session_runner!" | No node assigned to session |
{
"type": "error",
"message": "Unknown session id: lsn-abc123"
}