Skip to content

Commit

Permalink
Update evnsq::Client::Client(evpp::EventLoop* loop, Type t, const Opt…
Browse files Browse the repository at this point in the history
…ion& ops)
  • Loading branch information
zieckey committed Nov 9, 2016
1 parent f62d738 commit e09dbb5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/evnsq/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace evnsq {
static const std::string kNSQMagic = " V2";
static const std::string kOK = "OK";

Client::Client(evpp::EventLoop* l, Type t, const std::string& topic, const std::string& channel, const Option& ops)
: loop_(l), type_(t), option_(ops), topic_(topic), channel_(channel) {}
Client::Client(evpp::EventLoop* l, Type t, const Option& ops)
: loop_(l), type_(t), option_(ops) {}

Client::~Client() {}

Expand Down
4 changes: 3 additions & 1 deletion apps/evnsq/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ class EVNSQ_EXPORT Client {
return loop_;
}
protected:
Client(evpp::EventLoop* loop, Type t, const std::string& topic, const std::string& channel, const Option& ops);
Client(evpp::EventLoop* loop, Type t, const Option& ops);
void HandleLoopkupdHTTPResponse(
const std::shared_ptr<evpp::httpc::Response>& response,
const std::shared_ptr<evpp::httpc::Request>& request);
void OnConnection(const ConnPtr& conn);
void set_topic(const std::string& t) { topic_ = t; }
void set_channel(const std::string& c) { channel_ = c; }
private:
bool IsKnownNSQDAddress(const std::string& addr) const;
void MoveToConnectingList(const ConnPtr& conn);
Expand Down
4 changes: 3 additions & 1 deletion apps/evnsq/consumer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

namespace evnsq {
Consumer::Consumer(evpp::EventLoop* l, const std::string& topic, const std::string& channel, const Option& ops)
: Client(l, kConsumer, topic, channel, ops) {
: Client(l, kConsumer, ops) {
set_topic(topic);
set_channel(channel);
}

Consumer::~Consumer() {
Expand Down
2 changes: 1 addition & 1 deletion apps/evnsq/producer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace evnsq {

Producer::Producer(evpp::EventLoop* l, const Option& ops)
: Client(l, kProducer, "", "", ops)
: Client(l, kProducer, ops)
, current_conn_(0)
, wait_ack_count_(0)
, published_count_(0)
Expand Down

0 comments on commit e09dbb5

Please sign in to comment.