Execute the callback fn function with the passed span as the active span Note: The callback will be executed even if the span is null.

The current trace host instance (core or AISKU instance)

The span to set as the active span during the execution of the callback

the callback function

the this argument for the callback. If not provided, ISpanScope is used as this

the result of the function

  • Execute the callback fn function with the passed span as the active span Note: The callback will be executed even if the span is null.

    Type Parameters

    Parameters

    • traceHost: T

      The current trace host instance (core or AISKU instance)

    • span: IReadableSpan

      The span to set as the active span during the execution of the callback

    • fn: F

      the callback function

    • OptionalthisArg: ThisParameterType<F>

      the this argument for the callback. If not provided, ISpanScope is used as this

    • Rest..._args: A

      Additional arguments to be passed to the function

    Returns ReturnType<F>