MCPcopy Index your code
hub / github.com/grpc/grpc-java / attach

Method attach

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

Attach this context, thus enter a new scope within which this context is #current. The previously current context is returned. It is allowed to attach contexts where #isCancelled() is true. Instead of using attach() and #detach(Context) most use-cases are

()

Source from the content-addressed store, hash-verified

424 * }}</pre>
425 */
426 public Context attach() {
427 Context prev = storage().doAttach(this);
428 if (prev == null) {
429 return ROOT;
430 }
431 return prev;
432 }
433
434 /**
435 * Reverse an {@code attach()}, restoring the previous context and exiting the current scope.

Calls 2

storageMethod · 0.95
doAttachMethod · 0.45