package.dist.src.config.storage-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 default_momento_logger_1 = require("./logging/default-momento-logger");
const storage_configuration_1 = require("./storage-configuration");
const storage_1 = require("./transport/storage");
const fixed_timeout_retry_strategy_1 = require("./retry/fixed-timeout-retry-strategy");
const defaultLoggerFactory = new default_momento_logger_1.DefaultMomentoLoggerFactory();
function defaultRetryStrategy(loggerFactory) {
return new fixed_timeout_retry_strategy_1.FixedTimeoutRetryStrategy({
loggerFactory: loggerFactory,
});
}
/**
* Laptop config provides defaults suitable for a medium-to-high-latency dev environment.
* @export
* @class Laptop
*/
class Laptop extends storage_configuration_1.StorageClientConfiguration {
/**
* 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 {StorageConfiguration}
*/
static latest(loggerFactory = defaultLoggerFactory) {
return new storage_configuration_1.StorageClientConfiguration({
loggerFactory: loggerFactory,
transportStrategy: new storage_1.StaticStorageTransportStrategy({
grpcConfiguration: new storage_1.StaticStorageGrpcConfiguration({
deadlineMillis: 5000,
}),
}),
retryStrategy: defaultRetryStrategy(loggerFactory),
});
}
}
exports.Laptop = Laptop;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS1jb25maWd1cmF0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb25maWcvc3RvcmFnZS1jb25maWd1cmF0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSw2RUFBNkU7QUFDN0UsbUVBR2lDO0FBQ2pDLGlEQUc2QjtBQUM3Qix1RkFBK0U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