Skip to content

Commit

Permalink
Support more meta for ServerNode (#2603)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenBright authored Jun 3, 2024
1 parent b7092a7 commit a0984f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/brpc/server_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
#define BRPC_SERVER_NODE_H

#include <string>
#include <unordered_map>
#include "butil/endpoint.h"

namespace brpc {

// Representing a server inside a NamingService.
struct ServerNode {
ServerNode() {}
typedef std::unordered_map<std::string, std::string> MetaMap;

ServerNode() = default;

explicit ServerNode(const butil::EndPoint& pt) : addr(pt) {}

Expand All @@ -39,6 +42,7 @@ struct ServerNode {

butil::EndPoint addr;
std::string tag;
MetaMap meta_map;
};

inline bool operator<(const ServerNode& n1, const ServerNode& n2)
Expand Down

0 comments on commit a0984f6

Please sign in to comment.