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

Breadcrumb

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

function ObservableCallback::detach

Overrides ObservableCallbackInterface::detach

File

vendor/open-telemetry/sdk/Metrics/ObservableCallback.php, line 25

Class

ObservableCallback
@internal

Namespace

OpenTelemetry\SDK\Metrics

Code

public function detach() : void {
    if ($this->callbackId === null) {
        return;
    }
    $this->writer
        ->unregisterCallback($this->callbackId);
    $this->referenceCounter
        ->release();
    if ($this->callbackDestructor !== null) {
        unset($this->callbackDestructor->callbackIds[$this->callbackId]);
        if (!$this->callbackDestructor->callbackIds) {
            assert($this->target !== null);
            unset($this->callbackDestructor->destructors[$this->target]);
        }
    }
    $this->callbackId = null;
    $this->target = null;
}

API Navigation

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