/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Messenger/Event/WorkerStartedEvent.php
55 строк
1 KB
Nicolas Grekas
[Messenger] Improve PostgreSQL LISTEN/NOTIFY idle listener
17 фев 2026, 00:20
17 фев 2026, 00:20
8375c2c
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Messenger\Event; use Symfony\Component\Messenger\Worker; /** * Dispatched when a worker has been started. * * @author Tobias Schultze <http://tobion.de> */ final class WorkerStartedEvent { public function __construct( private Worker $worker, private ?float $deadline = null, private int $idleTimeout = 1000000, ) { } public function getWorker(): Worker { return $this->worker; } /** * Returns the absolute time (as a microtime(true) float) at which the * worker must stop, or null if no --time-limit was set. */ public function getDeadline(): ?float { return $this->deadline; } /** * Returns the duration in microseconds the worker sleeps between two * idle polling cycles (i.e. when no messages are found). * * Defaults to 1 000 000 µs (1 second). Corresponds to the * --sleep option of messenger:consume. */ public function getIdleTimeout(): int { return $this->idleTimeout; } }