import { SessionPingEvent } from "../../event/types/session/ping"; import { BiggyRunner } from "./biggy-runner"; /** * Specific runner used by Biggy Single Page application * stores. * * @export * @class BiggySPARunner * @extends {BiggyRunner} */ export class BiggySPARunner extends BiggyRunner { private timeout = 120; // How many seconds to run again /** * Main runner method. * * It will setup for a rerun of ping event every once and * a while. * * @abstract * @return {Promise} * @memberof Runner */ protected run(): Promise { setTimeout(this.ping, this.timeout * 1000); // eslint-disable-line return; } /** * Send a ping event * * @private * @return {Promise} * @memberof BiggySPARunner */ private async ping(): Promise { await new SessionPingEvent().push(); } }