Skip to content

Commit 1a05feb

Browse files
committed
Updated Doxygen comments.
Description of no_wait_on_empty and total_time for mchain's receive() and select() functions.
1 parent a20acad commit 1a05feb

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

dev/so_5/mchain.hpp

+25-1
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ perform_receive(
17911791
*
17921792
* \par Handlers format examples:
17931793
* \code
1794-
receive( ch, so_5::infinite_wait,
1794+
receive( from(ch).handle_n(1),
17951795
// Message instance by const reference.
17961796
[]( const std::string & v ) {...},
17971797
// Message instance by value (efficient for small types like int).
@@ -1808,6 +1808,17 @@ perform_receive(
18081808
[]( const so_5::mhood_t< yet_another_signal > & ) {...} );
18091809
* \endcode
18101810
*
1811+
* \note
1812+
* Since v.5.8.4 the value of empty_timeout (or no_wait_on_empty) is
1813+
* taken into account when `total_time` is specified. It means that
1814+
* in the following example the receive() returns immediately if
1815+
* the mchain is empty:
1816+
* \code
1817+
* receive(
1818+
* from(ch).handle_n(5).no_wait_on_empty().total_time(6s),
1819+
* [](const my_message & msg) {...});
1820+
* \endcode
1821+
*
18111822
* \since v.5.5.13
18121823
*/
18131824
template<
@@ -1957,6 +1968,19 @@ class prepared_receive_t
19571968
[]( const second_message_type & msg ) { ... }, ... );
19581969
* \endcode
19591970
*
1971+
* \note
1972+
* Since v.5.8.4 the value of empty_timeout (or no_wait_on_empty) is
1973+
* taken into account when `total_time` is specified. It means that
1974+
* in the following example the receive() returns immediately if
1975+
* the mchain is empty:
1976+
* \code
1977+
* auto prepared = prepare_receive(
1978+
* from(ch).handle_n(5).no_wait_on_empty().total_time(6s),
1979+
* [](const my_message & msg) {...});
1980+
* ...
1981+
* auto r = so_5::receive(prepared);
1982+
* \endcode
1983+
*
19601984
* \since v.5.5.17
19611985
*/
19621986
template<

dev/so_5/mchain_select.hpp

+43
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,18 @@ send_case(
16701670
... ) );
16711671
\endcode
16721672
*
1673+
* \note
1674+
* Since v.5.8.4 the value of empty_timeout (or no_wait_on_empty) is
1675+
* taken into account when `total_time` is specified. It means that
1676+
* in the following example the select() returns immediately if
1677+
* all mchains are empty:
1678+
* \code
1679+
* select(
1680+
* from_all().handle_n(5).no_wait_on_empty().total_time(6s),
1681+
* receive_case( ch1, ...),
1682+
* receive_case( ch2, ...) );
1683+
* \endcode
1684+
*
16731685
* \since v.5.5.16
16741686
*/
16751687
template<
@@ -1853,6 +1865,20 @@ class prepared_select_t
18531865
... ) );
18541866
* \endcode
18551867
*
1868+
* \note
1869+
* Since v.5.8.4 the value of empty_timeout (or no_wait_on_empty) is
1870+
* taken into account when `total_time` is specified. It means that
1871+
* in the following example the select() returns immediately if
1872+
* all mchains are empty:
1873+
* \code
1874+
* auto prepared = prepare_select(
1875+
* from_all().handle_n(5).no_wait_on_empty().total_time(6s),
1876+
* receive_case( ch1, ...),
1877+
* receive_case( ch2, ...) );
1878+
* ...
1879+
* so_5::select(prepared);
1880+
* \endcode
1881+
*
18561882
* \since v.5.5.17
18571883
*/
18581884
template<
@@ -2059,6 +2085,23 @@ class extensible_select_t
20592085
* receive_case(ch3, ...));
20602086
* \endcode
20612087
*
2088+
* \note
2089+
* Since v.5.8.4 the value of empty_timeout (or no_wait_on_empty) is
2090+
* taken into account when `total_time` is specified. It means that
2091+
* in the following example the select() returns immediately if
2092+
* all mchains are empty:
2093+
* \code
2094+
* // Creation of extensible-select instance with initial set of cases.
2095+
* auto sel = so_5::make_extensible_select(
2096+
* so_5::from_all().handle_n(10).no_wait_on_empty().total_time(6s),
2097+
* receive_case(ch1, ...),
2098+
* receive_case(ch2, ...));
2099+
* ...
2100+
* so_5::add_select_cases(sel, ...);
2101+
* ...
2102+
* auto r = select(sel);
2103+
* \endcode
2104+
*
20622105
* \since v.5.6.1
20632106
*/
20642107
template<

0 commit comments

Comments
 (0)