/** * @param $workers */ protected function registerWatchers($workers) { array_map(function (\Beanie\Worker $worker) { $worker->getTubeStatus()->setWatchedTubes($this->config->getWatchedTubes()); $this->eventLoop->registerJobListener($worker); }, $workers); $this->eventLoop->registerBreakCondition('time to live', [$this, 'checkTimeToLive'])->registerBreakCondition('maximal memory usage', [$this, 'checkMaximalMemoryUsage']); array_map(function ($terminationSignal) { $this->eventLoop->registerBreakSignal($terminationSignal); }, $this->config->getTerminationSignals()); }