Skip to content

Commit 1e79087

Browse files
j256pongad
authored andcommitted
Expose the publishAllOutstanding() method as public (#3093)
So that external systems that need to ensure that all messages have been published can clear a batch.
1 parent d0a2fc2 commit 1e79087

File tree

1 file changed

+6
-1
lines changed
  • google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1

1 file changed

+6
-1
lines changed

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,12 @@ public void run() {
290290
}
291291
}
292292

293-
private void publishAllOutstanding() {
293+
/**
294+
* Publish any outstanding batches if non-empty. This method sends buffered messages, but does
295+
* not wait for the send operations to complete. To wait for messages to send, call {@code get}
296+
* on the futures returned from {@code publish}.
297+
*/
298+
public void publishAllOutstanding() {
294299
messagesBatchLock.lock();
295300
OutstandingBatch batchToSend;
296301
try {

0 commit comments

Comments
 (0)