initialEmission = microtime(true); } public function select(): ?PayloadInterface { $now = microtime(true); if ($now - $this->initialEmission > self::ERROR_AFTER_S) { throw new Exception('Oh no!'); } if ($now - $this->lastEmission > self::DATA_AVAILABLE_INTERVAL_S) { $this->lastEmission = $now; return new DemoEmptyPayload(); } return null; } public function close(): void { } }