| | |
| | | // subscribe |
| | | typedef std::function<void(const std::string &proc_id, const MsgPublish &data)> SubDataCB; |
| | | bool SubscribeStartWorker(const SubDataCB &tdcb, int nworker = 2); |
| | | bool Subscribe(MsgTopicList &topics, MsgCommonReply &reply_body, const int timeout_ms); |
| | | bool Subscribe(MsgTopicList &topics, MsgCommonReply &reply_body, const int timeout_ms) |
| | | { |
| | | return DoSubscribe(topics, false, reply_body, timeout_ms); |
| | | } |
| | | bool SubscribeNet(MsgTopicList &topics, MsgCommonReply &reply_body, const int timeout_ms) |
| | | { |
| | | return DoSubscribe(topics, true, reply_body, timeout_ms); |
| | | } |
| | | bool DoSubscribe(MsgTopicList &topics, const bool net, MsgCommonReply &reply_body, const int timeout_ms); |
| | | bool RecvSub(std::string &proc_id, MsgPublish &pub, const int timeout_ms); |
| | | |
| | | void Start(ServerAsyncCB const &server_cb, SubDataCB const &sub_cb, RequestResultCB &client_cb, int nworker = 2); |