Tag: botwork

在Node.js Bot服务中实现Redis

博特信息 应用ID:776ba3b4-38e5-4582-809d-7c8d773cfe9b SDK平台:Node.js SDK版本: 活跃渠道:直线 部署环境:Auzure Bot服务 问题描述 我需要帮助实施Redis来保存Bot状态。 我正在一个项目中工作,这个项目的确需要我们尽可能减less延迟。 知道我们正在使用DocumentDB,但是由于Redis和内存一起工作,这可能会更快。 我已经按照教程使用mongo DB, Microsoft Bot框架MongoDB作为中间层来存储会话状态,数据和上下文,并且正在编辑文件/lib/IStorageClient.js来连接,保存和从redis中检索。 代码示例 这是我的/lib/IStorageClient.js实现,而不是使用MongoDB连接我已经把Redis的连接 "use strict"; var Consts = require('./Consts'); var redis = require('redis'); var IStorageClient = (function () { function IStorageClient(options) { this.options = options; } IStorageClient.prototype.initialize = function (callback) { var _this = this; var host = "MyRedis.redis.cache.windows.net"; var auth […]