package.dist.src.config.leaderboard-configurations.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
Client SDK for Momento services
The newest version!
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Laptop = void 0;
const leaderboard_configuration_1 = require("./leaderboard-configuration");
const __1 = require("../");
const default_momento_logger_1 = require("./logging/default-momento-logger");
// 4 minutes. We want to remain comfortably underneath the idle timeout for AWS NLB, which is 350s.
const defaultMaxIdleMillis = 4 * 60 * 1000;
const defaultMaxSessionMemoryMb = 256;
const defaultLoggerFactory = new default_momento_logger_1.DefaultMomentoLoggerFactory();
const defaultMiddlewares = [];
/**
* Laptop config provides defaults suitable for a medium-to-high-latency dev environment.
* @export
* @class Laptop
*/
class Laptop extends leaderboard_configuration_1.LeaderboardClientConfiguration {
/**
* Provides the latest recommended configuration for a laptop development environment. NOTE: this configuration may
* change in future releases to take advantage of improvements we identify for default configurations.
* @param {MomentoLoggerFactory} [loggerFactory=defaultLoggerFactory]
* @returns {LeaderboardConfiguration}
*/
static latest(loggerFactory = defaultLoggerFactory) {
return Laptop.v1(loggerFactory);
}
/**
* Provides v1 recommended configuration for a laptop development environment. This configuration is guaranteed not
* to change in future releases of the Momento web SDK.
* @param {MomentoLoggerFactory} [loggerFactory=defaultLoggerFactory]
* @returns {LeaderboardConfiguration}
*/
static v1(loggerFactory = defaultLoggerFactory) {
const deadlineMillis = 15000;
const grpcConfig = new __1.StaticGrpcConfiguration({
deadlineMillis: deadlineMillis,
maxSessionMemoryMb: defaultMaxSessionMemoryMb,
keepAlivePermitWithoutCalls: 1,
keepAliveTimeMs: 5000,
keepAliveTimeoutMs: 1000,
});
const transportStrategy = new __1.StaticTransportStrategy({
grpcConfiguration: grpcConfig,
maxIdleMillis: defaultMaxIdleMillis,
});
return new Laptop({
loggerFactory: loggerFactory,
transportStrategy: transportStrategy,
throwOnErrors: false,
middlewares: defaultMiddlewares,
});
}
}
exports.Laptop = Lapt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