executeCommandAsync() public static method

Note: As the command execution is done in a separate thread potential exceptions or failures will *not* be reported
public static executeCommandAsync ( string $commandIdentifier, array $settings, array $commandArguments = [] ) : void
$commandIdentifier string E.g. neos.flow:cache:flush
$settings array The Neos.Flow settings
$commandArguments array Command arguments
return void
Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function submit($payload, array $options = [])
 {
     $messageId = Algorithms::generateUUID();
     $message = new Message($messageId, $payload);
     $commandArguments = [$this->name, base64_encode(serialize($message))];
     if ($this->async) {
         if (!method_exists(Scripts::class, 'executeCommandAsync')) {
             throw new \RuntimeException('The "async" flag is set, but the currently used Flow version doesn\'t support this (Flow 3.3+ is required)', 1469116604);
         }
         Scripts::executeCommandAsync('flowpack.jobqueue.common:job:execute', $this->flowSettings, $commandArguments);
     } else {
         Scripts::executeCommand('flowpack.jobqueue.common:job:execute', $this->flowSettings, true, $commandArguments);
     }
     return $messageId;
 }