@eppo/node-server-sdk
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -13,2 +13,3 @@ "use strict"; | ||
const validation_1 = require("./validation"); | ||
let poller = null; | ||
/** | ||
@@ -34,3 +35,7 @@ * Initializes the Eppo client with configuration parameters. | ||
const configurationRequestor = new experiment_configuration_requestor_1.default(configurationStore, httpClient); | ||
const poller = (0, poller_1.default)(constants_1.POLL_INTERVAL_MILLIS, constants_1.JITTER_MILLIS, configurationRequestor.fetchAndStoreConfigurations.bind(configurationRequestor)); | ||
if (poller) { | ||
// if a client was already initialized, stop the polling process from the previous init call | ||
poller.stop(); | ||
} | ||
poller = (0, poller_1.default)(constants_1.POLL_INTERVAL_MILLIS, constants_1.JITTER_MILLIS, configurationRequestor.fetchAndStoreConfigurations.bind(configurationRequestor)); | ||
const startedPolling = poller.start(); | ||
@@ -37,0 +42,0 @@ return new eppo_client_1.default(() => startedPolling, configurationRequestor); |
@@ -1,2 +0,2 @@ | ||
interface IPoller { | ||
export interface IPoller { | ||
start: () => Promise<void>; | ||
@@ -6,3 +6,2 @@ stop: () => void; | ||
export default function initPoller(interval: number, jitterMillis: number, callback: () => Promise<any>): IPoller; | ||
export {}; | ||
//# sourceMappingURL=poller.d.ts.map |
{ | ||
"name": "@eppo/node-server-sdk", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Eppo node server SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47980
596