engine

package
v2.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package engine orchestrates the lifecycle, subsystem initialization, background workers, network servers, and graceful shutdown of RUSEON Core.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg *config.Config)

Run initializes and executes all core streaming subsystems, background workers, and API servers.

Prerequisites:

  • Dependency injection providers (registry.CurrentStateStore, registry.CurrentBlobStore, registry.CurrentAuthenticator, and registry.CurrentEventBus) must be registered prior to calling Run.

Lifecycle flow:

  1. Migrates initial YAML camera/tag definitions to the persistent StateStore (BadgerDB).
  2. Initializes the stream.Manager and loads active camera streams.
  3. Starts the optional MQTT metadata publisher worker.
  4. Starts the gRPC frame extractor & AI metadata ingestion server.
  5. Launches background periodic tasks (archive retention cleanup, billing metrics aggregation, database backup).
  6. Initializes the WebRTC engine (pregenerating ECDSA certificates and UDP muxing).
  7. Launches the primary HTTP/REST/HLS/WHEP API server (and optional pprof server).
  8. Blocks until a termination signal (SIGINT or SIGTERM) is received.
  9. Executes an ordered graceful shutdown (terminates background tasks, allows 5s for active HTTP requests, stops gRPC server, and closes all camera ingest/playback streams).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL