StopWorkerOnTimeLimitListener
Stops the worker when the time limit is reached.
Table of Contents
Methods
- __construct() : mixed
- hasStopped() : bool
- onWorkerRunning() : void
- onWorkerStarted() : void
Methods
__construct()
public
__construct([int $timeLimitInSeconds = 60 * 60 ][, LoggerInterface|null $logger = null ]) : mixed
Parameters
- $timeLimitInSeconds : int = 60 * 60
- $logger : LoggerInterface|null = null
hasStopped()
public
hasStopped() : bool
Return values
boolonWorkerRunning()
public
onWorkerRunning(WorkerRunningEvent $event) : void
Parameters
- $event : WorkerRunningEvent
Attributes
- #[AsEventListener]
- 'messenger-stopontime-on-worker-running'
onWorkerStarted()
public
onWorkerStarted(WorkerStartedEvent $event) : void
Parameters
- $event : WorkerStartedEvent
Attributes
- #[AsEventListener]
- 'messenger-stopontime-on-worker-started'