UNPKG

fleeta-api-lib

Version:

A comprehensive library for fleet management applications - API, Auth, Device management

129 lines 3.79 kB
/** * Stream Connection Pool * WebRTC 연결 풀 관리자 * 연결 재사용, 품질 관리, 리소스 최적화를 담당 */ import { MultiDeviceWebRTCConnection } from './WebRTCConnection'; import type { CameraChannel, StreamQuality, PoolStats } from './types'; /** * Pool configuration interface */ export interface PoolConfig { enablePooling: boolean; connectionTimeout: number; } /** * Stream Connection Pool Class * WebRTC 연결들을 효율적으로 관리하는 풀 */ export declare class StreamConnectionPool { private psn; private config; private connections; private connectionLimits; private isInitialized; private cleanupTimer; private channelMapping; /** * Create Stream Connection Pool instance * @param psn - Device PSN */ constructor(psn: string, config: PoolConfig); /** * Initialize the connection pool * 연결 풀 초기화 */ initialize(): Promise<void>; /** * Get connection from pool or create new one * 풀에서 연결 가져오기 또는 새로 생성 * @param channel - Camera channel * @param quality - Stream quality * @returns WebRTC connection instance */ getConnection(channel: CameraChannel, quality: StreamQuality): Promise<MultiDeviceWebRTCConnection>; /** * Change device channel via FleetA API * FleetA API를 통한 디바이스 채널 변경 * @param newChannel - New channel to switch to */ changeDeviceChannel(newChannel: CameraChannel): Promise<void>; /** * Get pool statistics * 풀 통계 조회 * @returns Pool statistics */ getPoolStats(): PoolStats; /** * Destroy pool and cleanup all connections * 풀 파괴 및 모든 연결 정리 */ destroy(): Promise<void>; /** * Create new WebRTC connection * 새 WebRTC 연결 생성 * @param channel - Camera channel * @param quality - Stream quality * @returns WebRTC connection instance */ private createConnection; /** * Get connections by quality level * 품질별 연결 목록 조회 * @param quality - Stream quality * @returns Array of pooled connections */ private getConnectionsByQuality; /** * Evict oldest connection of specified quality * 지정된 품질의 가장 오래된 연결 제거 * @param quality - Stream quality */ private evictOldestConnection; /** * Remove connection from pool * 풀에서 연결 제거 * @param connectionKey - Connection key to remove */ private removeConnection; /** * Find connection key for a pooled connection * 풀된 연결의 키 찾기 * @param targetConnection - Target pooled connection * @returns Connection key or null */ private findConnectionKey; /** * Calculate total memory usage * 총 메모리 사용량 계산 * @returns Memory usage in bytes */ private calculateMemoryUsage; /** * Calculate total bandwidth usage * 총 대역폭 사용량 계산 * @returns Bandwidth usage in bytes/sec */ private calculateBandwidthUsage; /** * Start cleanup timer for idle connections * 유휴 연결 정리 타이머 시작 */ private startCleanupTimer; /** * Stop cleanup timer * 정리 타이머 중지 */ private stopCleanupTimer; /** * Cleanup idle connections * 유휴 연결 정리 */ private cleanupIdleConnections; private handleConnectionStateChange; private handleConnectionError; private handleStreamReceived; private handleStatsUpdate; private handleVoiceCommStateChange; } //# sourceMappingURL=StreamConnectionPool.d.ts.map