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

commonMain.aws.smithy.kotlin.runtime.telemetry.context.Context.kt Maven / Gradle / Ivy

The newest version!
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package aws.smithy.kotlin.runtime.telemetry.context

/**
 * Context is an opaque propagation mechanism for telemetry providers to carry execution
 * scoped values across API boundaries.
 */
public interface Context {
    public companion object {
        /**
         * A no-op [Context]
         */
        public val None: Context = object : AbstractContext() { }
    }

    /**
     * Make this the currently active context
     *
     * @return handle to a [Scope] that MUST be disposed of (via [Scope.close]) when the current context
     * is considered no longer active (returning the current active context to whatever it was previously if set).
     */
    public fun makeCurrent(): Scope
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy