Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ public boolean needsExecutor() {
return delegate.needsExecutor();
}

@Nullable
@Override
public Executor getExecutor() {
return delegate.getExecutor();
}

@Override
@Deprecated
public BigtableTransportChannelProvider withExecutor(ScheduledExecutorService executor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ public boolean needsExecutor() {
return executor == null;
}

@Nullable
@Override
public Executor getExecutor() {
return executor;
}

@Deprecated
@Override
public TransportChannelProvider withExecutor(ScheduledExecutorService executor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ public boolean needsExecutor() {
return executor == null;
}

@Nullable
@Override
public Executor getExecutor() {
return executor;
}

@Deprecated
@Override
public TransportChannelProvider withExecutor(ScheduledExecutorService executor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import javax.annotation.Nullable;
Comment thread
igorbernstein2 marked this conversation as resolved.
Outdated

/** An instance of TransportChannelProvider that always provides the same TransportChannel. */
@InternalExtensionOnly
Expand All @@ -57,6 +58,12 @@ public boolean needsExecutor() {
return false;
}

@Nullable
@Override
public Executor getExecutor() {
Comment thread
blakeli0 marked this conversation as resolved.
Outdated
return null;
}

@Override
public FixedTransportChannelProvider withExecutor(ScheduledExecutorService executor) {
return withExecutor((Executor) executor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import javax.annotation.Nullable;

/**
* Provides an interface to either build a TransportChannel or provide a fixed TransportChannel that
Expand Down Expand Up @@ -70,6 +71,16 @@ public interface TransportChannelProvider {
@Deprecated
boolean needsExecutor();

/**
* @return the user provided executor. This can be null if the user didn't override the executor
* and the TransportProvider is using its internal executor.
* @throws UnsupportedOperationException if the TransportProvider doesn't support this method.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might missed this earlier, Java doc needs to be updated as well.

*/
@Nullable
default Executor getExecutor() {
return null;
}

/** Sets the executor to use when constructing a new {@link TransportChannel}. */
TransportChannelProvider withExecutor(Executor executor);

Expand Down
Loading