/** * @param string $command serialized command object * @return string */ public function actionHandle($command) { try { $command = unserialize(base64_decode($command)); $command->setRunningInBackground(true); $this->commandBus->handle($command); } catch (\Exception $e) { Console::error($e->getMessage()); } }
/** * @param $job * @return mixed|string */ protected function handle($job) { if (array_key_exists('serializer', $job['body'])) { $unserialize = $job['body']['serializer'][1]; $command = call_user_func($unserialize, $job['body']['object']); if ($command instanceof QueuedCommand) { $command->setRunningInQueue(true); return $this->commandBus->handle($command); } } Console::error("Malformed job ID#{$job['id']}"); $this->delete($job); }