diff options
author | imarom <imarom@cisco.com> | 2016-01-18 06:59:36 -0500 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-01-21 10:11:54 -0500 |
commit | 9932ff8dcf4f8b6b6f3986832f8a1a8f8461c743 (patch) | |
tree | 28c577725377131eafbd54319407066dcbd385a8 /src/publisher | |
parent | 11d328d3e40b04540489eec83ac484d5b06254bb (diff) |
async publish now
Diffstat (limited to 'src/publisher')
-rw-r--r-- | src/publisher/trex_publisher.cpp | 15 | ||||
-rw-r--r-- | src/publisher/trex_publisher.h | 12 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/publisher/trex_publisher.cpp b/src/publisher/trex_publisher.cpp index 35653069..f56d56df 100644 --- a/src/publisher/trex_publisher.cpp +++ b/src/publisher/trex_publisher.cpp @@ -94,6 +94,21 @@ TrexPublisher::publish_event(event_type_e type, const Json::Value &data) { publish_json(s); } +void +TrexPublisher::publish_barrier(uint32_t key) { + Json::FastWriter writer; + Json::Value value; + std::string s; + + value["name"] = "trex-barrier"; + value["type"] = key; + value["data"] = Json::objectValue; + + s = writer.write(value); + publish_json(s); +} + + /** * error handling * diff --git a/src/publisher/trex_publisher.h b/src/publisher/trex_publisher.h index 52978476..f086babb 100644 --- a/src/publisher/trex_publisher.h +++ b/src/publisher/trex_publisher.h @@ -53,8 +53,20 @@ public: }; + /** + * publishes an async event + * + */ virtual void publish_event(event_type_e type, const Json::Value &data = Json::nullValue); + /** + * publishes a barrier requested by the user + * + * @author imarom (17-Jan-16) + * + */ + virtual void publish_barrier(uint32_t key); + private: void show_zmq_last_error(const std::string &err); private: |