
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
timeoutengine
Advanced tools
Simple node module to find the 99%ile timeout value.
var wreck = require('wreck');
var timeoutengine = require('timeoutengine');
var defaultTimeout = 5000;
var serviceName = 'httpbin_get';
function makeServiceCall(callback) {
var options = {
timeout: timeoutengine.getSocketTimeout(serviceName) || defaultTimeout
};
var reqStart = Date.now();
var req = wreck.get('http://httpbin.org/get', options, function (err, response, payload) {
timeoutengine.addSocketDuration(serviceName, Date.now() - reqStart); //pumping the socket duration
if (!err && response && response.statusCode === 200 && payload) {
//console.log(payload.toString());
// do something this payload
}
callback();
});
}
I am making a service call from node and hardcoding a fixed socketTimeout (or connectTimeout) value for the same. I am not sure that is the ideal value I can use?
TimeoutEngine has API to feed the connect/socket durations and after let say N (default 100) request start returning the 99%ile + delta value. This is useful if you need adaptive timeout value based on the current server/network conditions.
configure(options)
- [Optional] Use if you want a different default config.addDuration(key, value)
- Generic addDuration APIgetTimeout(key)
- Generic getTimeout APIaddConnectDuration(key, value)
- Call this API to feed the connect duration of a service call for successful as well as failed requests.addSocketDuration(key, value)
- Call this API to feed the socket duration of a service call for successful as well as failed requests.getConnectTimeout(key)
- Returns this 99%ile + delta connect Timeout valuegetSocketTimeout(key)
- Returns this 99%ile + delta socket Timeout valueFAQs
Simple node module to find the 99%ile timeout value.
The npm package timeoutengine receives a total of 2 weekly downloads. As such, timeoutengine popularity was classified as not popular.
We found that timeoutengine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.