public function onMessageReceived($msg)
 {
     $rmi = new RequestMethodInvocation($msg);
     if (GlobalState::$TYPE == 'CLOUD' && time() * 1000 - $rmi->getTimestamp() > $this->timeout) {
         Log::writeError("RMI ignored by timeout" . $rmi, $target = 'file');
         return;
     }
     $code_executor = $this->executor_holder->getCodeExecutor($rmi->getApplicationId(), $rmi->getAppVersionId());
     $code_executor->invoke($rmi);
 }
 protected function RequestMethodInvocation($msg)
 {
     //invocation event handlers
     $rmi = new RequestMethodInvocation($msg);
     Log::writeInfo("Received RMI:" . $rmi, $target = 'file');
     if (GlobalState::$TYPE == 'CLOUD' && time() * 1000 - $rmi->getTimestamp() > $this->timeout) {
         Log::writeError("RMI ignored by timeout" . $rmi, $target = 'file');
         return;
     }
     if (GlobalState::$TYPE === 'CLOUD') {
         Config::$RELATIVE_PATH = $msg['relativePath'];
         Config::$TASK_APPLICATION_ID = $msg['applicationId'];
         ClassManager::analyze(PathBuilder::getClasses());
     }
     $code_executor = $this->executor_holder->getCodeExecutor($rmi->getApplicationId(), $rmi->getAppVersionId(), true);
     $code_executor->invokeMethod($rmi);
 }