15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SUBSCRIBER_CONNECTION_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SUBSCRIBER_CONNECTION_H
18#include "google/cloud/pubsub/application_callback.h"
19#include "google/cloud/pubsub/backoff_policy.h"
20#include "google/cloud/pubsub/connection_options.h"
21#include "google/cloud/pubsub/internal/subscriber_stub.h"
22#include "google/cloud/pubsub/message.h"
23#include "google/cloud/pubsub/pull_response.h"
24#include "google/cloud/pubsub/retry_policy.h"
25#include "google/cloud/pubsub/subscriber_options.h"
26#include "google/cloud/pubsub/subscription.h"
27#include "google/cloud/pubsub/version.h"
28#include "google/cloud/internal/non_constructible.h"
29#include "google/cloud/status_or.h"
31#include <initializer_list>
37GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
70 ExactlyOnceApplicationCallback
callback;
74
75
76
77
78
79
89
90
91
92
93
94
95
96
97GOOGLE_CLOUD_CPP_DEPRECATED(
98 "use `MakeSubscriberConnection(subscription) instead")
101 std::initializer_list<internal::NonConstructible>);
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171GOOGLE_CLOUD_CPP_DEPRECATED(
172 "use the overload consuming google::cloud::Options instead")
175 ConnectionOptions connection_options
= {},
176 std::unique_ptr<
pubsub::RetryPolicy
const> retry_policy = {},
177 std::unique_ptr<
pubsub::BackoffPolicy
const> backoff_policy = {});
179GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
182namespace pubsub_internal {
183GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
187 std::vector<std::shared_ptr<SubscriberStub>> stubs);
189GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
friend friend class future
A connection to the Cloud Pub/Sub service to receive events.
Definition: subscriber_connection.h:57
virtual future< Status > Subscribe(SubscribeParams p)
Defines the interface for Subscriber::Subscribe(ApplicationCallback)
virtual future< Status > ExactlyOnceSubscribe(ExactlyOnceSubscribeParams p)
Defines the interface for Subscriber::Subscribe(ExactlyOnceApplicationCallback).
virtual StatusOr< PullResponse > Pull()
virtual ~SubscriberConnection()=0
virtual Options options()
Returns the configuration parameters for this object.
Definition: subscriber_connection.h:85
Configure how a Subscriber handles incoming messages.
Definition: subscriber_options.h:97
Objects of this class identify a Cloud Pub/Sub subscription.
Definition: subscription.h:37
Contains all the Cloud Pub/Sub C++ client types and functions.
Definition: ack_handler.h:25
std::shared_ptr< SubscriberConnection > MakeSubscriberConnection(Subscription subscription, std::initializer_list< internal::NonConstructible >)
Creates a new SubscriberConnection object to work with Subscriber.
std::shared_ptr< SubscriberConnection > MakeSubscriberConnection(Subscription subscription, SubscriberOptions options, ConnectionOptions connection_options={}, std::unique_ptr< pubsub::RetryPolicy const > retry_policy={}, std::unique_ptr< pubsub::BackoffPolicy const > backoff_policy={})
Creates a new SubscriberConnection object to work with Subscriber.
std::shared_ptr< SubscriberConnection > MakeSubscriberConnection(Subscription subscription, Options opts={})
Creates a new SubscriberConnection object to work with Subscriber.
The namespace Google Cloud Platform C++ client libraries.
The response for a blocking pull.
Definition: pull_response.h:43
Definition: subscriber_connection.h:69
ExactlyOnceApplicationCallback callback
Definition: subscriber_connection.h:70
Wrap the arguments for Subscribe()
Definition: subscriber_connection.h:62
ApplicationCallback callback
Definition: subscriber_connection.h:63