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

Breadcrumb

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

function DelayedStalenessHandlerFactory::__construct

@psalm-suppress PropertyTypeCoercion

Parameters

float $delay delay in seconds:

File

vendor/open-telemetry/sdk/Metrics/StalenessHandler/DelayedStalenessHandlerFactory.php, line 28

Class

DelayedStalenessHandlerFactory

Namespace

OpenTelemetry\SDK\Metrics\StalenessHandler

Code

public function __construct(ClockInterface $clock, float $delay) {
    $this->nanoDelay = (int) ($delay * 1000000000.0);
    $this->stale = function (DelayedStalenessHandler $handler) : void {
        $this->staleHandlers[$handler] = $this->clock
            ->now();
    };
    $this->freshen = function (DelayedStalenessHandler $handler) : void {
        unset($this->staleHandlers[$handler]);
    };
    $this->staleHandlers = new WeakMap();
}
RSS feed
Powered by Drupal