\GuzzleHttp\CommandServiceClientInterface

Web service client interface.

Summary

Methods
Constants
getCommand()
execute()
executeAsync()
executeAll()
executeAllAsync()
getHttpClient()
getHandlerStack()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getCommand()

getCommand(string  $name, array  $args = []) : \GuzzleHttp\Command\CommandInterface

Create a command for an operation name.

Special keys may be set on the command to control how it behaves. Implementations SHOULD be able to utilize the following keys or throw an exception if unable.

Parameters

string $name

Name of the operation to use in the command

array $args

Arguments to pass to the command

Throws

\InvalidArgumentException

if no command can be found by name

Returns

\GuzzleHttp\Command\CommandInterface —

execute()

execute(\GuzzleHttp\Command\CommandInterface  $command) : \GuzzleHttp\Command\ResultInterface

Execute a single command.

Parameters

\GuzzleHttp\Command\CommandInterface $command

Command to execute

Throws

\GuzzleHttp\Command\Exception\CommandException

Returns

\GuzzleHttp\Command\ResultInterface —

The result of the executed command

executeAsync()

executeAsync(\GuzzleHttp\Command\CommandInterface  $command) : \GuzzleHttp\Promise\PromiseInterface

Execute a single command asynchronously

Parameters

\GuzzleHttp\Command\CommandInterface $command

Command to execute

Returns

\GuzzleHttp\Promise\PromiseInterface —

A Promise that resolves to a Result.

executeAll()

executeAll(array|\Iterator  $commands, array  $options = []) : array

Executes multiple commands concurrently using a fixed pool size.

Parameters

array|\Iterator $commands

Array or iterator that contains CommandInterface objects to execute with the client.

array $options

Associative array of options to apply.

  • concurrency: (int) Max number of commands to execute concurrently.
  • fulfilled: (callable) Function to invoke when a command completes.
  • rejected: (callable) Function to invoke when a command fails.

Returns

array —

executeAllAsync()

executeAllAsync(array|\Iterator  $commands, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Executes multiple commands concurrently and asynchronously using a fixed pool size.

Parameters

array|\Iterator $commands

Array or iterator that contains CommandInterface objects to execute with the client.

array $options

Associative array of options to apply.

  • concurrency: (int) Max number of commands to execute concurrently.
  • fulfilled: (callable) Function to invoke when a command completes.
  • rejected: (callable) Function to invoke when a command fails.

Returns

\GuzzleHttp\Promise\PromiseInterface —

getHttpClient()

getHttpClient() : \GuzzleHttp\ClientInterface

Get the HTTP client used to send requests for the web service client

Returns

\GuzzleHttp\ClientInterface —

getHandlerStack()

getHandlerStack() : \GuzzleHttp\HandlerStack

Get the HandlerStack which can be used to add middleware to the client.

Returns

\GuzzleHttp\HandlerStack —