package datadog.trace.context; /** An object when can propagate a datadog trace across multiple threads. */ public interface TraceScope { /** * Prevent the trace attached to this TraceScope from reporting until the returned Continuation * finishes. * *

Should be called on the parent thread. */ Continuation capture(); /** Close the activated context and allow any underlying spans to finish. */ void close(); /** Used to pass async context between workers. */ interface Continuation { /** * Activate the continuation. * *

Should be called on the child thread. */ TraceScope activate(); /** Cancel the continuation. */ void close(); } }