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

Method fixedContextExecutor

api/src/context/java/io/grpc/Context.java:601–610  ·  view source on GitHub ↗

Wrap an Executor so that it always executes with this context as the #current context. It is generally expected that #currentContextExecutor(Executor) would be used more commonly than this method. One scenario in which this executor may be useful is when a single thread i

(final Executor e)

Source from the content-addressed store, hash-verified

599 * @see #currentContextExecutor(Executor)
600 */
601 public Executor fixedContextExecutor(final Executor e) {
602 final class FixedContextExecutor implements Executor {
603 @Override
604 public void execute(Runnable r) {
605 e.execute(wrap(r));
606 }
607 }
608
609 return new FixedContextExecutor();
610 }
611
612 /**
613 * Create an executor that propagates the {@link #current} context when {@link Executor#execute}

Callers 1

fixedContextExecutorMethod · 0.95

Calls

no outgoing calls

Tested by 1

fixedContextExecutorMethod · 0.76