UNPKG

pg-trx-outbox

Version:

Transactional outbox of Postgres for Node.js with little Event Sourcing

20 lines (19 loc) 482 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Poller = void 0; class Poller { pollTimer; options; fsm; constructor(options, fsm) { this.options = options; this.fsm = fsm; } async start() { this.pollTimer = setInterval(() => this.fsm.send('poll'), this.options.outboxOptions?.pollInterval ?? 5000); } async stop() { clearInterval(this.pollTimer); } } exports.Poller = Poller;