///
import * as events from 'events';
import AppDatabase from './apps/database';
export declare enum ActivityMonitorStatus {
Starting = "starting",
Running = "running",
Idle = "idle",
Stopping = "stopping"
}
/**
* Monitors engine activity and emits an 'idle' event when engine is inactive.
* There are two monitoring timers. The first timer starts when there is no apps
* and resets on any activity. The second timer starts after the first timer
* expires and immdiately broadcasts a ping message to all conversations. Any
* activity from ping resoponse or other events will reset the timers.
* The reason for the second timer is to avoid bounce from an idle but connected
* client session, which reconnects when the connection is closed.
*/
export declare class ActivityMonitor extends events.EventEmitter {
private _name;
private _status;
private _appdb;
private _lastUpdate;
private _idleTimeout;
private _idleTimeoutMillis;
private _quiesceTimeout;
private _quiesceTimeoutMillis;
private _appAddedListener;
private _appRemovedListener;
constructor(appdb: AppDatabase, options?: {
idleTimeoutMillis?: number;
quiesceTimeoutMillis?: number;
});
set name(name: string);
get status(): ActivityMonitorStatus;
start(): Promise;
updateActivity(): void;
private _maybeStartActivityTimeout;
private _startQuiesce;
stop(): Promise;
}