function DelayedStalenessHandlerFactory::__construct
@psalm-suppress PropertyTypeCoercion
Parameters
float $delay delay in seconds:
File
-
vendor/
open-telemetry/ sdk/ Metrics/ StalenessHandler/ DelayedStalenessHandlerFactory.php, line 28
Class
Namespace
OpenTelemetry\SDK\Metrics\StalenessHandlerCode
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();
}