Execute the given command... after other running commands are complete.

@param object   $command
@param callable $next

@throws \Exception

@return mixed|void
160624
public function execute($command, callable $next)
    {
        $this->queue[] = function () use ($command, $next) {
            return $next($command);
        };

        if ($this->isExecuting) {
            return;
        }
        $this->isExecuting = true;

        try {
            $returnValue = $this->executeQueuedJobs();
        } catch (\Exception $e) {
            $this->isExecuting = false;
            $this->queue = [];
            throw $e;
        }

        $this->isExecuting = false;
        return $returnValue;
    }
549788
public function execute($command, callable $next)
    {
        $bus = $this->getBusForCommand($command);
        if ($bus === null) {
            return $next($command);
        }

        return $next($bus->handle($command));
    }
1093270
public function execute($command, callable $next)
    {
        $violations = $this->validator->validate($command);

        if ($violations->count() > 0) {
            throw new ValidationException(
                sprintf('Invalid command %s given', get_class($command)),
                0,
                null,
                $violations
            );
        }

        return $next($command);
    }
977055
protected function _execute($command) {
		try {
			if (!$class = $this->_instance($command)) {
				return false;
			}
		} catch (ClassNotFoundException $e) {
			return false;
		}
		$data = [];
		$params = $class->invokeMethod('_params');

		foreach ($params as $param) {
			$data[$param] = $class->invokeMethod("_{$param}", [$this->request]);
		}

		if ($message = $class->invokeMethod('_save', [$data])) {
			$this->out($message);
			return true;
		}
		return false;
	}
811219
public function registerCommand($command, $callable, array $options = [])
    {
        if (array_key_exists($command, $this->commands)) {
            throw new \Exception("A command with the name {$command} already exists.");
        }

        list($commandInstance, $options) = $this->buildCommand($command, $callable, $options);
        $this->commands[$command]        = $commandInstance;

        foreach ($options['aliases'] as $alias) {
            $this->addCommandAlias($alias, $command);
        }

        return $commandInstance;
    }
350215
protected function setCommand($command)
    {
        $this->command = $command;

        if (!is_null($this->loader)) {
            $this->loader->setCommand($this->command);
        }
    }
1351478
public function handle($command)
    {
        $this->commandStack[] = $command;

        if ($this->executing) {
            return;
        }

        $first = true;

        while ($command = array_shift($this->commandStack)) {
            $this->invokeHandler($command, $first);
            $first = false;
        }
    }
91747
public function fire(Command $command)
    {
        if ($command->option('verbose')) {
            $command->blockMessage('Migrations', 'Starting the module migrations ...', 'comment');
        }

        foreach ($this->modules as $module) {
            if ($command->option('verbose')) {
                $command->call('module:migrate', ['module' => $module]);
                continue;
            }
            $command->callSilent('module:migrate', ['module' => $module]);
        }
    }
755481
protected function executeCommand($command, $timeout = 300, $callback = null)
    {
        $process = new Process($this->prepare($command), $this->cwd, null, null, $timeout);
        $process->run($callback);
        if (!$process->isSuccessful()) {
            throw new \RuntimeException(sprintf('An error occurred when executing the "%s" command.', $command));
        }
    }
530396
public function fire(Command $command)
    {
        if ($command->option('verbose')) {
            $command->call('key:generate');
            $command->call('api:key-generate');

            return;
        }
        $command->callSilent('key:generate');
        $command->callSilent('api:key-generate');
    }
1349103
public function execute($command)
    {
        exec($command, $result, $returnValue);

        if ($returnValue === 0) {
            return $result;
        }

        throw new \RuntimeException(sprintf('Failed to execute command: %s', $command), $returnValue);
    }
410218
public function fire(Command $command)
    {
        $this->command = $command;

        if ($command->option('verbose')) {
            $command->blockMessage('Requirements', 'Checking System Requirements ...', 'comment');
        }

        $this->checkPHPVersion();
        $this->checkExtensions();

        $this->showResults();
    }
129798
public function execute($command, callable $next)
    {
        if (!$command->storage) {
            throw new \LogicException("Require storage before using this StoragePersistMiddleware!");
        }

        Manager::persist($command->storage);
        Manager::flush();

        return $next($command);
    }
1026271
public function execute($command, callable $next)
    {
        if ($command instanceof FallbackCommand) {
            $command->message = new TextTemplate();
            $command->message->text = "Oops! I dont know wath you say.";
        }

        return $next($command);
    }
1086162
public function execute(Command $command)
    {
        if ($this->locked === true) {
            $this->queue[] = $command;
            return null;
        }

        $this->locked = true;

        $response = $this->executeIgnoringLock($command);

        $this->executeQueue();

        $this->locked = false;

        return $response;
    }
983613
public function execute($command, callable $next)
    {
        $result = $next($command);

        $events = $this->eventStorage->release();
        $this->emitEvents($events);

        return $result;
    }
1271894
public function execute($command, callable $next)
    {
        if ($this->authorizationChecker->isGranted('handle', $command)) {
            return $next($command);
        }

        throw new AccessDeniedException(
            sprintf('The current user is not allowed to handle command of type \'%s\'', get_class($command))
        );
    }