Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS SDK support for timeouts and retries on startup #22

Merged
merged 8 commits into from
Jun 24, 2016
Prev Previous commit
Next Next commit
Linting fixes. Updated demos defaults.
  • Loading branch information
facundocabrera committed Jun 23, 2016
commit 4e86299db35a8f86865cee2df4844b1434531d04
29 changes: 10 additions & 19 deletions demos/browser-split/online/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,18 @@ var sdk = splitio({
key: '1f84e5ddb06a3e66145ccfc1aac247'
},
scheduler: {
// fetch feature updates each 1 sec
featuresRefreshRate: 3,
// fetch segment updates each 1 sec
segmentsRefreshRate: 5,
// publish metrics each 30 sec
metricsRefreshRate: 30,
// publish evaluations each 30 sec
impressionsRefreshRate: 30
// fetch feature updates each 15 sec
featuresRefreshRate: 15,
// fetch segment updates each 15 sec
segmentsRefreshRate: 15,
// publish metrics each 15 sec
metricsRefreshRate: 15,
// publish evaluations each 15 sec
impressionsRefreshRate: 15
},
urls: {
// crazy cdn
// sdk: 'http://localhost:3000/api'
sdk: 'https://sdk-aws-staging.split.io/api'
},
startup: {
// stress the request time used while starting up the SDK.
requestTimeoutBeforeReady: 1,
// how many quick retries we will do while starting up the SDK.
retriesOnFailureBeforeReady: 2,
// maximun amount of time used before notifies me a timeout.
readyTimeout: 1.5
sdk: 'https://sdk-aws-staging.split.io/api',
events: 'https://events-aws-staging.split.io/api'
}
});

Expand Down
2 changes: 1 addition & 1 deletion packages/splitio/es6/sdk/offline/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function offlineFactory(settings) {
}

// simulates data has been arrived asyncronously
setTimeout(function() {
setTimeout(function simulateDataArrived() {
hub.emit(Event.SDK_SPLITS_ARRIVED);
hub.emit(Event.SDK_SEGMENTS_ARRIVED);
}, 10);
Expand Down
2 changes: 1 addition & 1 deletion packages/splitio/lib/sdk/offline/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function offlineFactory(settings) {
}
}

setTimeout(function () {
setTimeout(function simulateDataArrived() {
hub.emit(Event.SDK_SPLITS_ARRIVED);
hub.emit(Event.SDK_SEGMENTS_ARRIVED);
}, 10);
Expand Down