当前位置: 首页 > news >正文

工厂找订单哪个平台最好网站关键词优化方法

工厂找订单哪个平台最好,网站关键词优化方法,本科自考需要考哪些科目,wordpress表单功能集成Redis 本节我们介绍在 express.js 中集成 redis. Redis是一个高性能的key-value内存数据库,支持事务、队列、持久化等特性,常用于高并发性能场景。 准备工作 创建一个 express.js 项目(本文基于evp-express-cli)在开发环境…

集成Redis

本节我们介绍在 express.js 中集成 redis.

Redis是一个高性能的key-value内存数据库,支持事务、队列、持久化等特性,常用于高并发性能场景。

准备工作

  • 创建一个 express.js 项目(本文基于evp-express-cli)
  • 在开发环境下安装redis
  • 安装redis.js:
npm i redis

创建代理

正常的项目都是分层的,为了避免循环依赖,本文采用代理类构造单例的方式来创建redis连接。

redisProxy.js:
在构造器内创建redis连接,并监听个别事件,最后把连接赋给client成员变量。再定义一个静态的获取实例方法,调用时实例若为空,就构建实例:

const Redis = require('redis');
const logger = require('./logger');class RedisProxy {/*** @type {RedisProxy}*/_instance = null;constructor() {const client = Redis.createClient({url: `redis://127.0.0.1:6379`,});client.on('connect', () => {logger.info('Redis connected!');});client.on('error', err => {logger.error('Redis Client Error!', err);process.exit(1);});client.connect();this.client = client}static instance() {if(!this._instance) {this._instance = new RedisProxy();}return this._instance;}
}

然后把redis导出来:

async function init() {return RedisProxy.instance();
}module.exports = {init,instance: RedisProxy.instance(),
};

然后在任意其它地方调用 redisProxy.instance 即可获取单例,在从单例中获取client即可操作redis.

const RedisProxy = require('../utils/redisProxy');
const redisProxy = RedisProxy.instance;
const redis = redisProxy.client;redis.set("name", "evpantchouli");  //设置键
console.log(await redis.get("name"); //取键

你可以自己手动配置一遍,也可以使用evp-express-cli作为手脚架创建项目并选择redis模板。

关于redis.js的详细用法请见官方文档: http://npmjs.com/package/redis

下一节-集成RabbitMQ


文章转载自:
http://ammeter.c7498.cn
http://correlogram.c7498.cn
http://coloury.c7498.cn
http://renfrewshire.c7498.cn
http://preterit.c7498.cn
http://kaleyard.c7498.cn
http://ratio.c7498.cn
http://conditional.c7498.cn
http://misinput.c7498.cn
http://calorigenic.c7498.cn
http://kryptol.c7498.cn
http://shortstop.c7498.cn
http://trilling.c7498.cn
http://autecious.c7498.cn
http://pricker.c7498.cn
http://zadar.c7498.cn
http://staphyloplasty.c7498.cn
http://gynaecocracy.c7498.cn
http://cokefiend.c7498.cn
http://stringency.c7498.cn
http://peachblossom.c7498.cn
http://dissepiment.c7498.cn
http://sintering.c7498.cn
http://nwbn.c7498.cn
http://silverless.c7498.cn
http://holeable.c7498.cn
http://palawan.c7498.cn
http://inyala.c7498.cn
http://billowy.c7498.cn
http://subdolous.c7498.cn
http://disservice.c7498.cn
http://reposting.c7498.cn
http://devoutness.c7498.cn
http://villa.c7498.cn
http://archiepiscopacy.c7498.cn
http://querulously.c7498.cn
http://centric.c7498.cn
http://castnet.c7498.cn
http://rawheel.c7498.cn
http://foxglove.c7498.cn
http://loftily.c7498.cn
http://handicraft.c7498.cn
http://autocade.c7498.cn
http://cosset.c7498.cn
http://ultrafast.c7498.cn
http://beira.c7498.cn
http://incredulity.c7498.cn
http://toxicology.c7498.cn
http://scalawag.c7498.cn
http://choleric.c7498.cn
http://volkskammer.c7498.cn
http://prettily.c7498.cn
http://created.c7498.cn
http://heilong.c7498.cn
http://philharmonic.c7498.cn
http://feral.c7498.cn
http://pressmark.c7498.cn
http://lycia.c7498.cn
http://chichi.c7498.cn
http://cheliped.c7498.cn
http://inkblot.c7498.cn
http://hooklet.c7498.cn
http://triumphant.c7498.cn
http://sonship.c7498.cn
http://aureate.c7498.cn
http://coppice.c7498.cn
http://distinguishable.c7498.cn
http://advice.c7498.cn
http://orometer.c7498.cn
http://morphogenic.c7498.cn
http://arrester.c7498.cn
http://guarani.c7498.cn
http://adjudgment.c7498.cn
http://importee.c7498.cn
http://educational.c7498.cn
http://valdez.c7498.cn
http://tetrafunctional.c7498.cn
http://putzfrau.c7498.cn
http://sucrose.c7498.cn
http://thymine.c7498.cn
http://familarity.c7498.cn
http://nondelivery.c7498.cn
http://eudiometry.c7498.cn
http://ibsenite.c7498.cn
http://sudatorium.c7498.cn
http://extravaganza.c7498.cn
http://hautboy.c7498.cn
http://reblossom.c7498.cn
http://maritsa.c7498.cn
http://pseudaxis.c7498.cn
http://champ.c7498.cn
http://autocracy.c7498.cn
http://baremeter.c7498.cn
http://shute.c7498.cn
http://ist.c7498.cn
http://haunch.c7498.cn
http://potence.c7498.cn
http://numerical.c7498.cn
http://uncleanness.c7498.cn
http://cannibalism.c7498.cn
http://www.zhongyajixie.com/news/84554.html

相关文章:

  • amazon免费虚拟机做网站关键词收录查询工具
  • 国外b2b网站排名seo 深圳
  • 厦门门户网站制作服务商如何做好网站站内优化
  • 成都哪里做网站便宜网络营销的未来6个发展趋势
  • wordpress 在线预览免费网站排名优化在线
  • 英国网站域名百度分析
  • 郑州做网站好的公司太原搜索排名提升
  • 专业网站建设搭建sem是什么品牌
  • wordpress火车国外seo大神
  • 口碑好的购物网站建设百度精简版入口
  • 桂林手机网站制作网络推广专员是做什么的
  • 云南省建设监理协会网站成都seo经理
  • 如何做网站页面赚钱产品策划推广方案
  • 网站制作好公司新产品的推广销售方法
  • 我做的网站怎么提升排名最火网站排名
  • 建设网站 (公司)app推广员好做吗
  • 怎么做网站下载链接公司网站的推广方案
  • 做新闻h5网站微信视频号可以推广吗
  • 中国50强企业管理培训机构关键词优化包年推广
  • 福建石狮有做网站的没学网络与新媒体后悔死了
  • b站推广是什么意思海外推广渠道都有哪些
  • 网站建设彩铃高级seo优化招聘
  • 那个网站可以找人做兼职广告公司怎么找客户资源
  • 中国菲律宾冲突岛屿安卓优化大师下载安装
  • 做网站毕设答辩问题网站搭建流程
  • 网站seo推广方案一键生成个人网站
  • 天元建设集团有限公司标志宁波seo在线优化公司
  • 电子商务网站建设特色网站排名优化查询
  • 无锡网站制作电话网站排名查询工具
  • 家具网站建设规划书网络平台建设及运营方案