Skip to content

Commit

Permalink
Pub/Sub: Update ApiFutures.addCallback() to take 3 arguments (#4120)
Browse files Browse the repository at this point in the history
* Update ApiFutures.addCallback()

* use DirectExecutor

* nit

* use directExecutor

* run formatter
  • Loading branch information
anguillanneuf authored and chingor13 committed Dec 3, 2018
1 parent 969bbee commit 50a8533
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.api.gax.rpc.ApiException;
import com.google.cloud.pubsub.v1.Publisher;
import com.google.cloud.pubsub.v1.TopicAdminClient;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.ByteString;
import com.google.pubsub.v1.ProjectTopicName;
import com.google.pubsub.v1.PubsubMessage;
Expand Down Expand Up @@ -120,7 +121,8 @@ public void onSuccess(String messageId) {
// Once published, returns server-assigned message ids (unique within the topic)
System.out.println(messageId);
}
});
},
MoreExecutors.directExecutor());
}
} finally {
if (publisher != null) {
Expand Down

0 comments on commit 50a8533

Please sign in to comment.