summaryrefslogtreecommitdiffstats
path: root/src/publisher
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-01-18 06:59:36 -0500
committerimarom <imarom@cisco.com>2016-01-21 10:11:54 -0500
commit9932ff8dcf4f8b6b6f3986832f8a1a8f8461c743 (patch)
tree28c577725377131eafbd54319407066dcbd385a8 /src/publisher
parent11d328d3e40b04540489eec83ac484d5b06254bb (diff)
async publish now
Diffstat (limited to 'src/publisher')
-rw-r--r--src/publisher/trex_publisher.cpp15
-rw-r--r--src/publisher/trex_publisher.h12
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: