All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.rocketmq.shaded.io.opentelemetry.context.Scope Maven / Gradle / Ivy

There is a newer version: 5.0.7
Show newest version
/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.apache.rocketmq.shaded.io.opentelemetry.context;

import org.apache.rocketmq.shaded.io.opentelemetry.context.ThreadLocalContextStorage.NoopScope;

/**
 * An {@link AutoCloseable} that represents a mounted context for a block of code. A failure to call
 * {@link Scope#close()} will generally break tracing or cause memory leaks. It is recommended that
 * you use this class with a {@code try-with-resources} block:
 *
 * 
{@code
 * try (Scope ignored = span.makeCurrent()) {
 *   ...
 * }
 * }
*/ public interface Scope extends AutoCloseable { /** * Returns a {@link Scope} that does nothing. Represents attaching a {@link Context} when it is * already attached. */ static Scope noop() { return NoopScope.INSTANCE; } @Override void close(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy