/** * A generic method to call Fatmouse Workflows. * * @param string $name Workflow name. * @param array $parameters Optional workflow parameters. * * @return \Fatmouse\AsyncResult Future result. */ private function asyncCall($name, array $parameters = null) { return $this->fatmouse->asyncCallApi(TaskName::RUN, ['name' => $name, 'parameters' => $parameters]); }
/** * Translate result message value into Task object. * * @return void * @throws Errors\ClientException When result message has not yet been received. */ private function translate() { if ($this->task) { return; } if (!isset($this->message)) { throw Errors\ClientException('Result has not yet been received'); } $celeryMsg = Util::jsonDecode($this->message->body); $this->task = Fatmouse::newTaskFromCeleryMessage($celeryMsg, $this->taskName); }