本文整理汇总了Java中io.grpc.internal.SerializingExecutor类的典型用法代码示例。如果您正苦于以下问题:Java SerializingExecutor类的具体用法?Java SerializingExecutor怎么用?Java SerializingExecutor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SerializingExecutor类属于io.grpc.internal包,在下文中一共展示了SerializingExecutor类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toStringMatches_noDeadline_default
import io.grpc.internal.SerializingExecutor; //导入依赖的package包/类
@Test
public void toStringMatches_noDeadline_default() {
String actual = allSet
.withDeadline(null)
.withExecutor(new SerializingExecutor(directExecutor()))
.withCallCredentials(null)
.withMaxInboundMessageSize(44)
.withMaxOutboundMessageSize(55)
.toString();
assertThat(actual).contains("deadline=null");
assertThat(actual).contains("authority=authority");
assertThat(actual).contains("callCredentials=null");
assertThat(actual).contains("executor=class io.grpc.internal.SerializingExecutor");
assertThat(actual).contains("compressorName=compressor");
assertThat(actual).contains("customOptions=[[option1, value1], [option2, value2]]");
assertThat(actual).contains("waitForReady=true");
assertThat(actual).contains("maxInboundMessageSize=44");
assertThat(actual).contains("maxOutboundMessageSize=55");
assertThat(actual).contains("streamTracerFactories=[tracerFactory1, tracerFactory2]");
}
示例2: OkHttpClientTransport
import io.grpc.internal.SerializingExecutor; //导入依赖的package包/类
OkHttpClientTransport(InetSocketAddress address, String authority, @Nullable String userAgent,
Executor executor, @Nullable SSLSocketFactory sslSocketFactory,
@Nullable HostnameVerifier hostnameVerifier, ConnectionSpec connectionSpec,
int maxMessageSize, @Nullable InetSocketAddress proxyAddress, @Nullable String proxyUsername,
@Nullable String proxyPassword, Runnable tooManyPingsRunnable,
TransportTracer transportTracer) {
this.address = Preconditions.checkNotNull(address, "address");
this.defaultAuthority = authority;
this.maxMessageSize = maxMessageSize;
this.executor = Preconditions.checkNotNull(executor, "executor");
serializingExecutor = new SerializingExecutor(executor);
// Client initiated streams are odd, server initiated ones are even. Server should not need to
// use it. We start clients at 3 to avoid conflicting with HTTP negotiation.
nextStreamId = 3;
this.sslSocketFactory = sslSocketFactory;
this.hostnameVerifier = hostnameVerifier;
this.connectionSpec = Preconditions.checkNotNull(connectionSpec, "connectionSpec");
this.stopwatchFactory = GrpcUtil.STOPWATCH_SUPPLIER;
this.userAgent = GrpcUtil.getGrpcUserAgent("okhttp", userAgent);
this.proxyAddress = proxyAddress;
this.proxyUsername = proxyUsername;
this.proxyPassword = proxyPassword;
this.tooManyPingsRunnable =
Preconditions.checkNotNull(tooManyPingsRunnable, "tooManyPingsRunnable");
this.transportTracer = Preconditions.checkNotNull(transportTracer);
initTransportTracer();
}
示例3: getSerializingExecutor
import io.grpc.internal.SerializingExecutor; //导入依赖的package包/类
/**
* Get the shared executor.
*/
public static Executor getSerializingExecutor() {
return new SerializingExecutor(executor);
}
示例4: AsyncFrameWriter
import io.grpc.internal.SerializingExecutor; //导入依赖的package包/类
public AsyncFrameWriter(OkHttpClientTransport transport, SerializingExecutor executor) {
this.transport = transport;
this.executor = executor;
}