Skip to content

Commit

Permalink
Added user guide documentation to show how to use the @http parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremeamia committed Jul 2, 2015
1 parent 2df31b3 commit 18a0a19
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 10 deletions.
35 changes: 28 additions & 7 deletions docs/getting-started/basic-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,17 @@ same as the namespace of a service (e.g., "S3", "DynamoDb", etc.).
$client = $sdk->createDynamoDb();
Service-specific configuration values are a union of the service-specific
values and the root-level values (i.e., service-specific values are shallow
merged onto root level values).
values and the root-level values (i.e., service-specific values are
shallow-merged onto root level values).

.. tip::

It is highly recommended that you use the ``Sdk`` class to create clients
if you are utilizing multiple SDK clients in your application. The ``Sdk``
class will automatically utilize the same HTTP client for each SDK client,
allowing SDK clients for different services to perform non-blocking HTTP
requests. If the SDK clients do not use the same HTTP client, then HTTP
requests sent by the SDK client may cause inter-service promise
if you are utilizing multiple client instances in your application. The
``Sdk`` class will automatically utilize the same HTTP client for each SDK
client, allowing SDK clients for different services to perform non-blocking
HTTP requests. If the SDK clients do not use the same HTTP client, then
HTTP requests sent by the SDK client may cause inter-service promise
orchestration to block.


Expand Down Expand Up @@ -172,6 +172,27 @@ operation in the SDK's API Documentation (e.g., see the API docs for
`putObject operation <http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#putobject>`__).


HTTP Handler Options
~~~~~~~~~~~~~~~~~~~~

It's also possible to fine tune how the underlying HTTP handler executes the
request by using the special ``@http`` parameter. The options you can include
in the ``@http`` parameter are the same as the ones you can set when you
instantiate the client with the :ref:`"http" client option <config_http>`.

.. code-block:: php
// Send the request through a proxy.
$result = $s3Client->putObject([
'Bucket' => 'my-bucket',
'Key' => 'my-key',
'Body' => 'this is the body!',
'@http' => [
'proxy' => 'http://192.168.16.1:10'
]
]);
Asynchronous Requests
---------------------

Expand Down
23 changes: 20 additions & 3 deletions docs/guide/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The following examples are functionally equivalent:
$result = $s3Client->execute($command);
Command Parameters
Command parameters
------------------

When you create a command using a client's ``getCommand()`` method, it does not
Expand All @@ -71,6 +71,23 @@ opportunity to modify the command object before executing the command.
$result = $s3Client->execute($command);
HTTP handler options
--------------------

All commands support the special ``@http`` parameter. Using this parameter,
it's possible to fine tune how the underlying HTTP handler executes the
request. The options you can include in the ``@http`` parameter are the same as
the ones you can set when you instantiate the client with the
:ref:`"http" client option <config_http>`.

.. code-block:: php
// Configures the command to be delayed by 500 milliseconds.
$command['@http'] = [
'delay' => 500,
];
Command HandlerList
-------------------

Expand Down Expand Up @@ -264,8 +281,8 @@ objects, so we will need to map over the ``SplFileInfo`` objects to return
$promise->then(function() { echo "Done\n"; });
CommandPool Config
~~~~~~~~~~~~~~~~~~
CommandPool configuration
~~~~~~~~~~~~~~~~~~~~~~~~~

The ``Aws\CommandPool`` constructor accepts various configuration options.

Expand Down
2 changes: 2 additions & 0 deletions docs/guide/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ them in FIFO order.
$client->listTables();
.. _config_http:

http
~~~~

Expand Down

0 comments on commit 18a0a19

Please sign in to comment.