aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/pubsub
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pubsub')
-rw-r--r--examples/pubsub/main.cc10
-rw-r--r--examples/pubsub/publisher.cc2
-rw-r--r--examples/pubsub/publisher.h5
-rw-r--r--examples/pubsub/publisher_test.cc8
-rw-r--r--examples/pubsub/subscriber.cc2
-rw-r--r--examples/pubsub/subscriber.h5
-rw-r--r--examples/pubsub/subscriber_test.cc6
7 files changed, 15 insertions, 23 deletions
diff --git a/examples/pubsub/main.cc b/examples/pubsub/main.cc
index b1898f18d9..32102dcb5c 100644
--- a/examples/pubsub/main.cc
+++ b/examples/pubsub/main.cc
@@ -37,18 +37,16 @@
#include <string>
#include <thread>
+#include <gflags/gflags.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
-#include <gflags/gflags.h>
-#include <grpc++/channel_arguments.h>
-#include <grpc++/channel_interface.h>
+#include <grpc++/channel.h>
#include <grpc++/create_channel.h>
#include <grpc++/credentials.h>
-#include <grpc++/status.h>
-#include "test/cpp/util/test_config.h"
#include "examples/pubsub/publisher.h"
#include "examples/pubsub/subscriber.h"
+#include "test/cpp/util/test_config.h"
DEFINE_int32(server_port, 443, "Server port.");
DEFINE_string(server_host, "pubsub-staging.googleapis.com",
@@ -72,7 +70,7 @@ int main(int argc, char** argv) {
ss << FLAGS_server_host << ":" << FLAGS_server_port;
std::shared_ptr<grpc::Credentials> creds = grpc::GoogleDefaultCredentials();
- std::shared_ptr<grpc::ChannelInterface> channel =
+ std::shared_ptr<grpc::Channel> channel =
grpc::CreateChannel(ss.str(), creds, grpc::ChannelArguments());
grpc::examples::pubsub::Publisher publisher(channel);
diff --git a/examples/pubsub/publisher.cc b/examples/pubsub/publisher.cc
index 458050af73..fd38ca92ed 100644
--- a/examples/pubsub/publisher.cc
+++ b/examples/pubsub/publisher.cc
@@ -50,7 +50,7 @@ namespace grpc {
namespace examples {
namespace pubsub {
-Publisher::Publisher(std::shared_ptr<ChannelInterface> channel)
+Publisher::Publisher(std::shared_ptr<Channel> channel)
: stub_(PublisherService::NewStub(channel)) {}
void Publisher::Shutdown() { stub_.reset(); }
diff --git a/examples/pubsub/publisher.h b/examples/pubsub/publisher.h
index 33bcf98df4..02e6194b0b 100644
--- a/examples/pubsub/publisher.h
+++ b/examples/pubsub/publisher.h
@@ -34,8 +34,7 @@
#ifndef GRPC_EXAMPLES_PUBSUB_PUBLISHER_H
#define GRPC_EXAMPLES_PUBSUB_PUBLISHER_H
-#include <grpc++/channel_interface.h>
-#include <grpc++/status.h>
+#include <grpc++/channel.h>
#include "examples/pubsub/pubsub.grpc.pb.h"
@@ -45,7 +44,7 @@ namespace pubsub {
class Publisher {
public:
- Publisher(std::shared_ptr<ChannelInterface> channel);
+ Publisher(std::shared_ptr<Channel> channel);
void Shutdown();
Status CreateTopic(const grpc::string& topic);
diff --git a/examples/pubsub/publisher_test.cc b/examples/pubsub/publisher_test.cc
index 6b9dcacc49..c2eb295ef2 100644
--- a/examples/pubsub/publisher_test.cc
+++ b/examples/pubsub/publisher_test.cc
@@ -31,22 +31,20 @@
*
*/
-#include <grpc++/channel_arguments.h>
-#include <grpc++/channel_interface.h>
+#include <grpc++/channel.h>
#include <grpc++/client_context.h>
#include <grpc++/create_channel.h>
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
#include <grpc++/server_credentials.h>
-#include <grpc++/status.h>
#include <gtest/gtest.h>
#include "examples/pubsub/publisher.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
-using grpc::ChannelInterface;
+using grpc::Channel;
namespace grpc {
namespace testing {
@@ -124,7 +122,7 @@ class PublisherTest : public ::testing::Test {
std::unique_ptr<Server> server_;
PublisherServiceImpl service_;
- std::shared_ptr<ChannelInterface> channel_;
+ std::shared_ptr<Channel> channel_;
std::unique_ptr<grpc::examples::pubsub::Publisher> publisher_;
};
diff --git a/examples/pubsub/subscriber.cc b/examples/pubsub/subscriber.cc
index d9e0292ba0..0818f501db 100644
--- a/examples/pubsub/subscriber.cc
+++ b/examples/pubsub/subscriber.cc
@@ -48,7 +48,7 @@ namespace grpc {
namespace examples {
namespace pubsub {
-Subscriber::Subscriber(std::shared_ptr<ChannelInterface> channel)
+Subscriber::Subscriber(std::shared_ptr<Channel> channel)
: stub_(SubscriberService::NewStub(channel)) {}
void Subscriber::Shutdown() { stub_.reset(); }
diff --git a/examples/pubsub/subscriber.h b/examples/pubsub/subscriber.h
index 40ab45471d..c5b1df0d3e 100644
--- a/examples/pubsub/subscriber.h
+++ b/examples/pubsub/subscriber.h
@@ -34,8 +34,7 @@
#ifndef GRPC_EXAMPLES_PUBSUB_SUBSCRIBER_H
#define GRPC_EXAMPLES_PUBSUB_SUBSCRIBER_H
-#include <grpc++/channel_interface.h>
-#include <grpc++/status.h>
+#include <grpc++/channel.h>
#include "examples/pubsub/pubsub.grpc.pb.h"
@@ -45,7 +44,7 @@ namespace pubsub {
class Subscriber {
public:
- Subscriber(std::shared_ptr<ChannelInterface> channel);
+ Subscriber(std::shared_ptr<Channel> channel);
void Shutdown();
Status CreateSubscription(const grpc::string& topic,
diff --git a/examples/pubsub/subscriber_test.cc b/examples/pubsub/subscriber_test.cc
index b0e7fc034b..c5a077f407 100644
--- a/examples/pubsub/subscriber_test.cc
+++ b/examples/pubsub/subscriber_test.cc
@@ -31,15 +31,13 @@
*
*/
-#include <grpc++/channel_arguments.h>
-#include <grpc++/channel_interface.h>
+#include <grpc++/channel.h>
#include <grpc++/client_context.h>
#include <grpc++/create_channel.h>
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
#include <grpc++/server_credentials.h>
-#include <grpc++/status.h>
#include <gtest/gtest.h>
#include "examples/pubsub/subscriber.h"
@@ -122,7 +120,7 @@ class SubscriberTest : public ::testing::Test {
std::unique_ptr<Server> server_;
SubscriberServiceImpl service_;
- std::shared_ptr<ChannelInterface> channel_;
+ std::shared_ptr<Channel> channel_;
std::unique_ptr<grpc::examples::pubsub::Subscriber> subscriber_;
};