Skip to content

Session Initializer

app.application.managers.session_initializer

View source code

Session runtime bootstrapper.

This helper keeps Session construction side-effect free by moving the expensive runtime setup out of Session.__init__ and into the application layer.

See Also

Layer: Application. Context: Coordinates session-scoped lifecycles for application workers and resources.

SessionInitializer

Build and attach the runtime collaborators for a Session.

Responsibilities
  • Open the video reader for the session path.
  • Build SessionState from the reader metadata.
  • Create and start the session's decode worker.

The initializer intentionally keeps object construction separate from lifetime management so tests can instantiate Session without opening files or starting threads.

Layer: Application. Context: Coordinates use-case behavior through domain services and application contracts.

initialize(session: Session) -> Session

Attach the video reader, runtime view_state, and decode worker.

PARAMETER DESCRIPTION
session

The bare Session shell created by SessionManager.

TYPE: Session

RETURNS DESCRIPTION
Session

The same session instance after its runtime collaborators have been

Session

attached.