客户端信道类 更多...
#include <channel.hpp>
Public 类型 | |
| using | ptr = std::shared_ptr< Channel > |
| 信道句柄 | |
| using | ptr = std::shared_ptr< Channel > |
Public 成员函数 | |
| Channel (const muduo::net::TcpConnectionPtr &conn, const ProtobufCodecPtr &codec) | |
| 构造函数 | |
| ~Channel () | |
| bool | openChannel () |
| 创建信道请求 | |
| void | closeChannel () |
| 关闭信道请求 | |
| bool | declareExchange (const std::string &name, ExchangeType type, bool durable, bool auto_delete, google::protobuf::Map< std::string, std::string > &args) |
| 声明交换机 | |
| void | deleteExchange (const std::string &name) |
| 删除指定交换机 | |
| bool | declareQueue (const std::string &qname, bool qdurable, bool qexclusive, bool qauto_delete, google::protobuf::Map< std::string, std::string > &qargs) |
| 声明消息队列 | |
| void | deleteQueue (const std::string &qname) |
| 删除消息队列 | |
| bool | queueBind (const std::string &ename, const std::string &qname, const std::string &key) |
| 添加绑定信息 | |
| void | queueUnBind (const std::string &ename, const std::string &qname) |
| 解除绑定信息 | |
| void | basicPublish (const std::string &ename, const BasicProperties *bp, const std::string &body) |
| 向指定交换机发布消息 | |
| void | basicAck (const std::string &msg_id) |
| 应答消息 | |
| bool | basicConsume (const std::string &tag, const std::string &qname, bool auto_ack, const ConsumerCallback &cb) |
| 订阅消息 | |
| void | basicCancel () |
| 取消订阅 | |
| void | putBasicResponse (const basicResponsePtr &resp) |
| 连接收到基础响应后向映射表添加 | |
| void | consume (const basicConsumeResponsePtr &resp) |
| 连接收到推送消息 找到对应的消费者对象 通过回调函数进行消息处理 | |
| std::string | cid () |
| Channel (const std::string &id, const VirtualHost::ptr &host, const ConsumerManager::ptr &cmp, const ProtobufCodecPtr &codec, const muduo::net::TcpConnectionPtr &conn, const threadpool::ptr &pool) | |
| 信道构造函数 | |
| ~Channel () | |
| 析构函数 | |
| void | declareExchange (const declareExchangeRequestPtr &req) |
| 声明交换机请求处理函数 | |
| void | deleteExchange (const deleteExchangeRequestPtr &req) |
| 删除交换机请求处理函数 | |
| void | declareQueue (const declareQueueRequestPtr &req) |
| 声明队列请求处理函数 | |
| void | deleteQueue (const deleteQueueRequestPtr &req) |
| 删除队列请求处理函数 | |
| void | queueBind (const queueBindRequestPtr &req) |
| 队列绑定请求处理函数 | |
| void | queueUnBind (const queueUnBindRequestPtr &req) |
| 队列解绑请求处理函数 | |
| void | basicPublish (const basicPublishRequestPtr &req) |
| 消息发布请求处理函数 | |
| void | basicAck (const basicAckRequestPtr &req) |
| 确认消息请求处理函数 | |
| void | basicConsume (const basicConsumeRequestPtr &req) |
| 订阅消息请求处理函数 | |
| void | basicCancel (const basicCancelRequestPtr &req) |
| 取消订阅请求处理函数 | |
Private 成员函数 | |
| basicResponsePtr | waitResponse (const std::string &rid) |
| 等待处理响应 | |
| void | basicRespFunc (bool ok, const std::string &rid, const std::string &cid) |
| 基础响应发送函数 | |
| void | consume (const std::string &qname) |
| 消费调用函数 | |
| void | callback (const std::string &tag, const BasicProperties *bp, const std::string &body) |
| 消费者回调函数 | |
Private 属性 | |
| std::string | _cid |
| 信道id | |
| muduo::net::TcpConnectionPtr | _conn |
| 连接 | |
| ProtobufCodecPtr | _codec |
| 协议处理句柄 | |
| Consumer::ptr | _consumer |
| 信道角色描述 | |
| std::mutex | _mutex |
| 互斥锁 | |
| std::condition_variable | _cv |
| 条件变量 | |
| std::unordered_map< std::string, basicResponsePtr > | _basic_resp |
| 基础响应映射表 | |
| ConsumerManager::ptr | _cmp |
| 消费者管理句柄 | |
| VirtualHost::ptr | _host |
| 虚拟机 | |
| threadpool::ptr | _pool |
| 线程池 | |
客户端信道类
信道类
| using XuMQ::Channel::ptr = std::shared_ptr<Channel> |
信道句柄
| using XuMQ::Channel::ptr = std::shared_ptr<Channel> |
|
inline |
构造函数
| conn | muduo连接句柄 |
| codec | 协议处理句柄 |
|
inline |

|
inline |
信道构造函数
| id | 信道id |
| host | 虚拟机 |
| cmp | 消费者管理句柄 |
| codec | 协议处理句柄 |
| conn | muduo连接管理句柄 |
| pool | 线程池管理句柄 |
|
inline |
析构函数
|
inline |
确认消息请求处理函数
| req | 确认消息请求 |

|
inline |
应答消息
| msg_id | 消息id |

|
inline |
取消订阅


|
inline |
取消订阅请求处理函数
| req | 取消订阅请求 |

|
inline |
订阅消息请求处理函数
| req | 订阅消息请求 |

|
inline |
订阅消息
| tag | 消费者标识 |
| qname | 队列名称 |
| auto_ack | 自动应答标志 |
| cb | 消费者回调函数 |

|
inline |
消息发布请求处理函数
| req | 消息发布请求 |

|
inline |
向指定交换机发布消息
| ename | 交换机名称 |
| bp | 消息属性 |
| body | 消息主体 |

|
inlineprivate |
基础响应发送函数
| ok | 响应结果 |
| rid | 信道id |
| cid | 请求id |


|
inlineprivate |
消费者回调函数
| tag | 消费者标识 |
| bp | 消息属性 |
| body | 消息主体 |


|
inline |

|
inline |
关闭信道请求

|
inline |
连接收到推送消息 找到对应的消费者对象 通过回调函数进行消息处理
| resp | 消费响应句柄 |

|
inlineprivate |
消费调用函数
| qname | 队列名称 |
|
inline |
声明交换机请求处理函数
| req | 声明交换机请求 |

|
inline |
声明交换机
| name | 交换机名称 |
| type | 交换机类型 |
| durable | 数据持久化标志 |
| auto_delete | 自动删除标志 |
| args | 其他参数 |

|
inline |
声明队列请求处理函数
| req | 声明队列请求 |

|
inline |
声明消息队列
| qname | 消息队列名称 |
| qdurable | 数据持久化标志 |
| qexclusive | 独占标志 |
| qauto_delete | 自动删除标志 |
| qargs | 其他参数 |

|
inline |
删除交换机请求处理函数
| req | 删除交换机请求 |

|
inline |
删除指定交换机
| name | 交换机名称 |

|
inline |
删除队列请求处理函数
| req | 删除队列请求 |

|
inline |
删除消息队列
| name | 消息队列名称 |

|
inline |
创建信道请求

|
inline |
连接收到基础响应后向映射表添加
| resp | 响应句柄 |
|
inline |
队列绑定请求处理函数
| req | 队列绑定请求 |

|
inline |
添加绑定信息
| ename | 交换机名称 |
| qname | 消息队列名称 |
| key | 绑定关键字 |

|
inline |
队列解绑请求处理函数
| req | 队列解绑请求 |

|
inline |
解除绑定信息
| ename | 交换机名称 |
| qname | 消息队列名称 |

|
inlineprivate |
等待处理响应
| rid | 响应id |

|
private |
基础响应映射表
|
private |
信道id
|
private |
消费者管理句柄
|
private |
协议处理句柄
|
private |
连接
muduo连接管理句柄
|
private |
信道角色描述
消费者对象
|
private |
条件变量
|
private |
虚拟机
|
private |
互斥锁
|
private |
线程池