当前位置: 首页> 娱乐> 明星 > 天辰工程信息网_锐捷网络公司排名_高级搜索入口_产品推广策划

天辰工程信息网_锐捷网络公司排名_高级搜索入口_产品推广策划

时间:2025/7/18 20:50:04来源:https://blog.csdn.net/weixin_74113106/article/details/142577333 浏览次数:0次
天辰工程信息网_锐捷网络公司排名_高级搜索入口_产品推广策划

和服务端的消费者实现方式一模一样,只不过服务端的消费者的回调函数是把消息封装成响应并发送,固定都是这个动作,而客户端消费者回调是用来处理消息,是用户自己设置的。

#pragma once
#include "../common/Log.hpp"
#include "../common/message.pb.h"
#include <functional>
#include <memory>
#include <atomic>
#include <mutex>
#include <vector>
#include <unordered_map>
namespace ns_consumer
{using namespace ns_log;struct Consumer;using ConsumerPtr = std::shared_ptr<Consumer>;using ConsumerCallback_t = std::function<void(const ns_data::Message& msg)>;struct Consumer{std::string _id;std::string _qname;ConsumerCallback_t _callback;bool _autoAck;Consumer(const std::string id, const std::string &qname, ConsumerCallback_t callback, bool autoAck): _id(id),_qname(qname),_callback(callback),_autoAck(autoAck){}};
};
关键字:天辰工程信息网_锐捷网络公司排名_高级搜索入口_产品推广策划

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: