Skip to content

Commit 2f3b78a

Browse files
authored
---
yaml --- r: 8845 b: refs/heads/lesv-patch-1 c: e2165af h: refs/heads/master i: 8843: 32895e8
1 parent 01ba8d6 commit 2f3b78a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ refs/tags/v0.22.0: 18b298fe4bfe8ec2f20b0e0bf7ffdcce5cc3c5fe
6666
refs/heads/vam-google-patch-1: d0c8fee3a4074d0bf7360ce8c4f7f7223d0ee7b9
6767
refs/heads/vam-google-patch-CODEOWNERS: 2ac1616e25229e51d08a984708ef1918f91a35ee
6868
refs/heads/danoscarmike-patch-1: 7342a9916bce4ed00002c7202e2a16c5d46afaea
69-
refs/heads/lesv-patch-1: a8309e55a9fce22327e81ead0f4b83ed14a30a32
69+
refs/heads/lesv-patch-1: e2165af332ec9790c81fa66b7544332454012fb3
7070
refs/heads/ml-update-branch: 079dd6610017f5c51b9d1938c12d6d55b61513cf
7171
refs/heads/vkedia-patch-2: 7d8241388a9769a5c069334761b06c7012c878e7
7272
refs/heads/vkedia-patch-3: 4d128043acaa7db9160faf439d2ca6104e8a88cb

branches/lesv-patch-1/google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/CreateSubscriptionAndConsumeMessages.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ public void failed(Subscriber.State from, Throwable failure) {
6262
MoreExecutors.directExecutor());
6363
subscriber.startAsync().awaitRunning();
6464

65+
// In this example, we will pull messages for one minute (60,000ms) then stop.
66+
// In a real application, this sleep-then-stop is not necessary.
67+
// Simply call stopAsync().awaitTerminated() when the server is shutting down, etc.
6568
Thread.sleep(60000);
6669
} finally {
6770
if (subscriber != null) {
68-
subscriber.stopAsync();
71+
subscriber.stopAsync().awaitTerminated();
6972
}
7073
}
7174
}

0 commit comments

Comments
 (0)