Skip to content

Commit 2578db3

Browse files
committed
pr comment
1 parent 613b96b commit 2578db3

1 file changed

Lines changed: 17 additions & 25 deletions

File tree

  • google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1

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

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,23 @@ interface LongRandom {
550550
long nextLong(long least, long bound);
551551
}
552552

553-
/** Constructs a new {@link Builder} using the given topic. */
553+
/**
554+
* Constructs a new {@link Builder} using the given topic.
555+
*
556+
* <p>Example of creating a {@code Publisher}.
557+
*
558+
* <pre>{@code
559+
* String projectName = "my_project";
560+
* String topicName = "my_topic";
561+
* TopicName topic = TopicName.create(projectName, topicName);
562+
* Publisher publisher = Publisher.newBuilder(topic).build();
563+
* try {
564+
* // ...
565+
* } finally {
566+
* // When finished with the publisher, make sure to shutdown to free up resources.
567+
* publisher.shutdown();
568+
* }
569+
*/
554570
public static Builder newBuilder(TopicName topicName) {
555571
return new Builder(topicName);
556572
}
@@ -622,30 +638,6 @@ private Builder(TopicName topic) {
622638
* <p>For performance, this client benefits from having multiple channels open at once. Users
623639
* are encouraged to provide instances of {@code ChannelProvider} that creates new channels
624640
* instead of returning pre-initialized ones.
625-
*
626-
* <p>Example of creating a {@code Publisher}.
627-
*
628-
* <pre>{@code
629-
* String projectName = "my_project";
630-
* String topicName = "my_topic";
631-
* TopicName topic = TopicName.create(projectName, topicName);
632-
* Publisher publisher = Publisher.newBuilder(topic).build();
633-
* }</pre>
634-
*
635-
* <p>Example of creating a {@code Publisher}.
636-
*
637-
* <pre>{@code
638-
* String projectName = "my_project";
639-
* String topicName = "my_topic";
640-
* TopicName topic = TopicName.create(projectName, topicName);
641-
* Publisher publisher = Publisher.newBuilder(topic).build();
642-
* try {
643-
* // ...
644-
* } finally {
645-
* // When finished with the publisher, make sure to shutdown to free up resources.
646-
* publisher.shutdown();
647-
* }
648-
* }</pre>
649641
*/
650642
public Builder setChannelProvider(ChannelProvider channelProvider) {
651643
this.channelProvider = Preconditions.checkNotNull(channelProvider);

0 commit comments

Comments
 (0)