MCPcopy Create free account
hub / github.com/grpc/grpc-java / getExecutor

Method getExecutor

benchmarks/src/main/java/io/grpc/benchmarks/Utils.java:159–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157 private static ExecutorService clientExecutor;
158
159 private static synchronized ExecutorService getExecutor() {
160 if (clientExecutor == null) {
161 clientExecutor = new ForkJoinPool(
162 Runtime.getRuntime().availableProcessors(),
163 new ForkJoinWorkerThreadFactory() {
164 final AtomicInteger num = new AtomicInteger();
165 @Override
166 public ForkJoinWorkerThread newThread(ForkJoinPool pool) {
167 ForkJoinWorkerThread thread = defaultForkJoinWorkerThreadFactory.newThread(pool);
168 thread.setDaemon(true);
169 thread.setName("grpc-client-app-" + "-" + num.getAndIncrement());
170 return thread;
171 }
172 }, UncaughtExceptionHandlers.systemExit(), true /* async */);
173 }
174 return clientExecutor;
175 }
176
177 /**
178 * Create a {@link ManagedChannel} for the given parameters.

Callers 1

newClientChannelMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected