Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AsynchronousInstruments.php

class AsynchronousInstruments

@internal

Hierarchy

  • class \OpenTelemetry\SDK\Metrics\AsynchronousInstruments

Expanded class hierarchy of AsynchronousInstruments

File

vendor/open-telemetry/sdk/Metrics/AsynchronousInstruments.php, line 16

Namespace

OpenTelemetry\SDK\Metrics
View source
final class AsynchronousInstruments {
    
    /**
     * @param ArrayAccess<object, ObservableCallbackDestructor> $destructors
     * @param non-empty-list<Instrument> $instruments
     */
    public static function observe(MetricWriterInterface $writer, ArrayAccess $destructors, callable $callback, array $instruments, ReferenceCounterInterface $referenceCounter) : ObservableCallbackInterface {
        $target = null;
        $callback = weaken(closure($callback), $target);
        $callbackId = $writer->registerCallback($callback, ...$instruments);
        $referenceCounter->acquire();
        $destructor = null;
        if ($target) {
            $destructor = $destructors[$target] ??= new ObservableCallbackDestructor($destructors, $writer);
            $destructor->callbackIds[$callbackId] = $referenceCounter;
        }
        return new ObservableCallback($writer, $referenceCounter, $callbackId, $destructor, $target);
    }

}

Members

Title Sort descending Modifiers Object type Summary
AsynchronousInstruments::observe public static function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal