protected function handleWorkerInit(Worker $worker, Register $msg)
    {
        $actionCount = intval(count($msg->getActions()));
        if ($actionCount <= 0) {
            $this->getLogger()->error('Invalid init, invalid action count.');

            return;
        }

        foreach ($msg->getActions() as $actionName) {
            $worker->addAction($actionName);

            $action = $this->getActionName($actionName);
            $action->addWorker($worker);
        }

        $this->getLogger()->info('New worker ('.$worker->getHexId().') with '.$actionCount.' actions.');
        $this->getLogger()->debug('Actions for worker '.$worker->getHexId().': '.implode(', ', $worker->getActionList()));

        $worker->setValid(true);

        $this->reply($worker, new HeartbeatResponseWorkerhandler());

        $this->getLogger()->debug('Worker '.bin2hex($worker->getId()).' initialised.');
    }