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

Method currentContextExecutor

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

Create an executor that propagates the #current context when Executor#execute is called as the #current context of the Runnable scheduled. Note that this is a static method. @see #fixedContextExecutor(Executor)

(final Executor e)

Source from the content-addressed store, hash-verified

617 * @see #fixedContextExecutor(Executor)
618 */
619 public static Executor currentContextExecutor(final Executor e) {
620 final class CurrentContextExecutor implements Executor {
621 @Override
622 public void execute(Runnable r) {
623 e.execute(Context.current().wrap(r));
624 }
625 }
626
627 return new CurrentContextExecutor();
628 }
629
630 /**
631 * A context which inherits cancellation from its parent but which can also be independently

Callers 4

unaryCallMethod · 0.95
unaryCallMethod · 0.95
onMessageMethod · 0.95

Calls

no outgoing calls

Tested by 4

unaryCallMethod · 0.76
unaryCallMethod · 0.76
onMessageMethod · 0.76