import type Subscription from './subscription'; export declare const DEFAULT_START_DELAY = 5000; export declare const INACTIVITY_LENIENCY = 22000; interface OnOrphanFoundHandler { (subscription: Subscription): void; } /** * Finds subscriptions that have become orphaned. This only happens if an open api server goes down, but it requires that * the orphaned subscription is restarted. A simpler implementation would be to have a setTimeout/clearTimeout onActivity * in each subscription, but this class was abstracted for performance in order to reduce the number of setTimeouts/clearTimeouts * - with any number of subscriptions at the smallest refresh interval, with millions of updates per second, this class only * checks subscriptions when a new one is started and then once per second overall. */ declare class StreamingOrphanFinder { subscriptions: Subscription[]; nextUpdateTime: number; onOrphanFound: OnOrphanFoundHandler; startDelay: number; enabled: boolean; nextUpdateTimeoutId: number | null; minCheckTime: number; constructor(subscriptions: Subscription[], onOrphanFound: OnOrphanFoundHandler, startDelay?: number); private onUpdateTimeout; /** * Starts the orphan-finder. * It will delay reporting orphans for a set amount of time */ start(): void; stop(): void; update(): void; } export default StreamingOrphanFinder;