15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_PUBLISHER_OPTIONS_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_PUBLISHER_OPTIONS_H
18#include "google/cloud/pubsub/options.h"
19#include "google/cloud/pubsub/version.h"
20#include "google/cloud/options.h"
29GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
31GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
34namespace pubsub_internal {
35GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
37GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
41GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
67 GOOGLE_CLOUD_CPP_DEPRECATED(
"use `google::cloud::Options{}` instead")
71
72
73
74
75
76
77
78
79
80
81
82
83 GOOGLE_CLOUD_CPP_DEPRECATED(
"use `google::cloud::Options{}` instead")
87
88
89
90
91
92
93
94
95
96
100 GOOGLE_CLOUD_CPP_DEPRECATED(
101 "use `google::cloud::Options{}` and `MaxHoldTimeOption` instead")
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122 template <
typename Rep,
typename Period>
123 GOOGLE_CLOUD_CPP_DEPRECATED(
124 "use `google::cloud::Options{}` and `MaxHoldTimeOption` instead")
126 std::chrono::duration<Rep, Period> v) {
128 std::chrono::duration_cast<std::chrono::microseconds>(v));
134 GOOGLE_CLOUD_CPP_DEPRECATED(
135 "use `google::cloud::Options{}` and `MaxBatchMessagesOption` instead")
141
142
143
144
145
146
147
148
149
150
151
152
153 GOOGLE_CLOUD_CPP_DEPRECATED(
154 "use `google::cloud::Options{}` and `MaxBatchMessagesOption` instead")
162 GOOGLE_CLOUD_CPP_DEPRECATED(
163 "use `google::cloud::Options{}` and `MaxBatchBytesOption` instead")
169
170
171
172
173
174
175
176
177
178
179
180
181 GOOGLE_CLOUD_CPP_DEPRECATED(
182 "use `google::cloud::Options{}` and `MaxBatchBytesOption` instead")
190
191
192
193
194
195
196
197
198
199
200
204
205
206
207
208
209 GOOGLE_CLOUD_CPP_DEPRECATED(
210 "use `google::cloud::Options{}` and `MessageOrderingOption` instead")
214
215
216
217
218
219
220
221 GOOGLE_CLOUD_CPP_DEPRECATED(
222 "use `google::cloud::Options{}` and `MessageOrderingOption` instead")
229
230
231
232
233
234
235
236 GOOGLE_CLOUD_CPP_DEPRECATED(
237 "use `google::cloud::Options{}` and `MessageOrderingOption` instead")
245
246
247
248
249
250
251
252
253
254
258
259
260
261
262
263 GOOGLE_CLOUD_CPP_DEPRECATED(
264 "use `google::cloud::Options{}` and `MaxPendingBytesOption` instead")
271
272
273
274
275
276 GOOGLE_CLOUD_CPP_DEPRECATED(
277 "use `google::cloud::Options{}` and `MaxPendingMessagesOption` instead")
285 GOOGLE_CLOUD_CPP_DEPRECATED(
286 "use `google::cloud::Options{}` and `MaxPendingBytesOption` instead")
293 GOOGLE_CLOUD_CPP_DEPRECATED(
294 "use `google::cloud::Options{}` and `MaxPendingMessagesOption` instead")
300
301
302
303
304
305 GOOGLE_CLOUD_CPP_DEPRECATED(
306 "use `google::cloud::Options{}` and `FullPublisherActionOption` instead")
313
314
315
316
317
318 GOOGLE_CLOUD_CPP_DEPRECATED(
319 "use `google::cloud::Options{}` and `FullPublisherActionOption` instead")
326
327
328
329
330
331 GOOGLE_CLOUD_CPP_DEPRECATED(
332 "use `google::cloud::Options{}` and `FullPublisherActionOption` instead")
339
340
341
342
343
344 GOOGLE_CLOUD_CPP_DEPRECATED(
345 "use `google::cloud::Options{}` and `FullPublisherActionOption` instead")
352
353
354
355
356
357 GOOGLE_CLOUD_CPP_DEPRECATED(
358 "use `google::cloud::Options{}` and `FullPublisherActionOption` instead")
365
366
367
368
369
370 GOOGLE_CLOUD_CPP_DEPRECATED(
371 "use `google::cloud::Options{}` and `FullPublisherActionOption` instead")
383GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
386namespace pubsub_internal {
387GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
390 return std::move(o.opts_);
393GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
ValueTypeT< T > const & get() const
Options & set(ValueTypeT< T > v)
Configuration options for a Publisher.
Definition: publisher_options.h:64
std::size_t maximum_batch_message_count() const
Definition: publisher_options.h:136
PublisherOptions & set_full_publisher_rejects()
Configure the publisher to reject new messages when full.
Definition: publisher_options.h:359
bool full_publisher_blocks() const
The current action for a full publisher.
Definition: publisher_options.h:333
bool full_publisher_ignored() const
The current action for a full publisher.
Definition: publisher_options.h:307
std::size_t maximum_pending_bytes() const
Definition: publisher_options.h:287
std::chrono::microseconds maximum_hold_time() const
Definition: publisher_options.h:102
PublisherOptions & set_maximum_pending_messages(std::size_t v)
Flow control based on pending messages.
Definition: publisher_options.h:278
PublisherOptions & enable_message_ordering()
Enable message ordering.
Definition: publisher_options.h:223
PublisherOptions & set_maximum_batch_message_count(std::size_t v)
Set the maximum number of messages in a batch.
Definition: publisher_options.h:155
PublisherOptions & disable_message_ordering()
Disable message ordering.
Definition: publisher_options.h:238
PublisherOptions & set_full_publisher_ignored()
Ignore full publishers, continue as usual.
Definition: publisher_options.h:346
PublisherOptions & set_maximum_batch_bytes(std::size_t v)
Set the maximum size for the messages in a batch.
Definition: publisher_options.h:183
std::size_t maximum_batch_bytes() const
Definition: publisher_options.h:164
PublisherOptions & set_maximum_pending_bytes(std::size_t v)
Flow control based on pending bytes.
Definition: publisher_options.h:265
PublisherOptions & set_full_publisher_blocks()
Configure the publisher to block the caller when full.
Definition: publisher_options.h:372
bool message_ordering() const
Return true if message ordering is enabled.
Definition: publisher_options.h:211
bool full_publisher_rejects() const
The current action for a full publisher.
Definition: publisher_options.h:320
PublisherOptions(Options opts)
Initialize the publisher options.
PublisherOptions & set_maximum_hold_time(std::chrono::duration< Rep, Period > v)
Sets the maximum hold time for the messages.
Definition: publisher_options.h:125
std::size_t maximum_pending_messages() const
Definition: publisher_options.h:295
Contains all the Cloud Pub/Sub C++ client types and functions.
Definition: ack_handler.h:25
FullPublisherAction
Actions taken by a full publisher.
Definition: options.h:180
@ kRejects
Configure the publisher to reject new messages when full.
@ kIgnored
Ignore full publishers, continue as usual.
@ kBlocks
Configure the publisher to block the caller when full.
The namespace Google Cloud Platform C++ client libraries.
The action taken by a full publisher.
Definition: options.h:193
The maximum size for the messages in a batch.
Definition: options.h:121
The maximum number of messages in a batch.
Definition: options.h:105
The maximum hold time for the messages.
Definition: options.h:89
The maximum size for pending messages.
Definition: options.h:155
The maximum number of pending messages.
Definition: options.h:138
Publisher message ordering.
Definition: options.h:175