EMQX消息存储Redis源码分析(1)

本文主要探讨EMQX数据存储与Redis的整合,涉及关键库包括eredis、eredis_cluster和ecpool。首先,启动EMQX_backend_redis应用及监听者emqx_backend_redis_sup,接着注册Redis统计,最后加载emqx_backend_redis模块。
摘要由CSDN通过智能技术生成

EMQX 数据存储Redis主要牵涉到几个外部的库文件:

1、 eredis:Non-blocking Redis client with focus on performance and robustness https://github.com/wooga/eredis.git 

2、eredis_cluster:eredis_cluster is a wrapper for eredis to support cluster mode of redis  https://github.com/adrienmo/eredis_cluster.git 

3、ecpool: It is different with worker-pool libraries in that it is designed to pool connection/clients to server or database https://github.com/emqx/ecpool.git

下面分析第一个文件emqx_backend_redis_app.erl。

第一步、启动emqx_backend_redis application,

第二步、启动应用的第一个监听者emqx_backend_redis_sup

第三步、注册Redis统计

第四步、载入emqx_backend_redis模块

-module(emqx_backend_redis_app).

-include("../include/emqx_backend_redis.hrl").

-behaviour(
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值