Skip to content

Commit d70c887

Browse files
committed
Fleshing out Async Client description; checking some typos; describing tag structure.
1 parent d311612 commit d70c887

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

libs/network/doc/reference_http_client.rst

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ General
99
use and embed in your own applications. All of the HTTP client implementations:
1010

1111
* **Cannot be copied.** This means you may have to store instances of the
12-
clients in dynamic memory.
12+
clients in dynamic memory if you intend to use them as function parameters
13+
or pass them around in smart pointers or by reference.
1314
* **Assume that requests made are independent of each other.** There currently
1415
is no cookie or session management system built-in to cpp-netlib's HTTP client
1516
implementations.
@@ -46,11 +47,20 @@ the HTTP client implementation provided by :mod:`cpp-netlib`.
4647

4748
.. include:: http_client_tags.rst
4849

50+
In the above table the tags follow a pattern for describing the behavior
51+
introduced by the tags. This pattern is shown below:
52+
53+
<protocol>_<modifier>_<character-width>_<resolve-strategy>
54+
55+
For example, the tag ``http_default_8bit_tcp_resolve`` indicates the protocol
56+
``http``, a modifier ``default``, a character width of ``8bit``, and a resolve
57+
strategy of ``tcp_resolve``.
58+
4959
Synchronous Clients
5060
~~~~~~~~~~~~~~~~~~~
5161

5262
Of the client tags shown in the table, the following makes the ``basic_client``
53-
behave as a fully synchonous client.
63+
behave as a fully synchronous client.
5464

5565
* **http_default_8bit_tcp_resolve**
5666
* **http_default_8bit_udp_resolve**
@@ -68,7 +78,29 @@ are encountered in the performance of the HTTP requests.
6878
Asynchronous Clients
6979
~~~~~~~~~~~~~~~~~~~~
7080

71-
.. FIXME show the table of tags that enable the asynchronous implementation.
81+
The following tags specify the ``basic_client`` to behave in an asynchronous
82+
manner:
83+
84+
* **http_async_8bit_tcp_resolve**
85+
* **http_async_8bit_udp_resolve**
86+
87+
An asynchronous client implementation means that``basic_client<...>`` is an
88+
`Active Object`_. This means that the client has and manages its own lifetime
89+
thread, and returns values that are asynchronously filled in. The response
90+
object encapsulates Boost.Thread_ futures which get filled in once the values
91+
are available.
92+
93+
.. _Boost.Thread: http://www.boost.org/libs/thread
94+
.. _`Active Object`: http://en.wikipedia.org/wiki/Active_object
95+
96+
The asynchronous clients implement all operations asynchronously which are hidden
97+
from the user. The interface is still synchronous but the fetching of data
98+
happens on a different thread.
99+
100+
.. note:: The asynchronous clients are thread safe, and can be shared across
101+
many threads. Each request starts a sequence of asynchronous operations
102+
dedicated to that request. The client does not re-cycle connections and uses
103+
a one-request-one-connection model.
72104

73105
Member Functions
74106
----------------

0 commit comments

Comments
 (0)