List of usage examples for io.netty.util.concurrent FastThreadLocal set
public final void set(V value)
From source file:com.linecorp.armeria.internal.tracing.SpanContextUtil.java
License:Apache License
/** * Sets up the {@link RequestContext} to push and pop the {@link Span} whenever it is entered/exited. *//*from w w w .j a va 2 s. c om*/ public static void setupContext(FastThreadLocal<SpanInScope> threadLocalSpan, RequestContext ctx, Span span, Tracer tracer) { ctx.onEnter(unused -> threadLocalSpan.set(tracer.withSpanInScope(span))); ctx.onExit(unused -> { SpanInScope spanInScope = threadLocalSpan.get(); if (spanInScope != null) { spanInScope.close(); threadLocalSpan.remove(); } }); }