File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1 Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 6666import java .util .Map ;
6767import java .util .concurrent .Callable ;
6868import java .util .concurrent .CountDownLatch ;
69+ import java .util .concurrent .Executor ;
6970import java .util .concurrent .ScheduledExecutorService ;
7071import java .util .concurrent .ScheduledFuture ;
7172import java .util .concurrent .TimeUnit ;
@@ -569,6 +570,7 @@ public void onFailure(Throwable t) {
569570 };
570571
571572 ApiFuture <PublishResponse > future ;
573+ Executor callbackExecutor = directExecutor ();
572574 if (outstandingBatch .orderingKey == null || outstandingBatch .orderingKey .isEmpty ()) {
573575 future = publishCall (outstandingBatch );
574576 } else {
@@ -581,8 +583,9 @@ public ApiFuture<PublishResponse> call() {
581583 return publishCall (outstandingBatch );
582584 }
583585 });
586+ callbackExecutor = this .executor ;
584587 }
585- ApiFutures .addCallback (future , futureCallback , directExecutor () );
588+ ApiFutures .addCallback (future , futureCallback , callbackExecutor );
586589 }
587590
588591 private final class OutstandingBatch {
You can’t perform that action at this time.
0 commit comments