Fix up dispatch() documentation. Clarify distinction between post() and defer().

This commit is contained in:
Christopher Kohlhoff 2019-03-07 15:19:13 +11:00
parent c7d4557434
commit 45abc54125
4 changed files with 30 additions and 6 deletions

View File

@ -31,6 +31,11 @@ namespace asio {
* executor. The function object is queued for execution, and is never called
* from the current thread prior to returning from <tt>defer()</tt>.
*
* The use of @c defer(), rather than @ref post(), indicates the caller's
* preference that the executor defer the queueing of the function object. This
* may allow the executor to optimise queueing for cases when the function
* object represents a continuation of the current call context.
*
* This function has the following effects:
*
* @li Constructs a function object handler of type @c Handler, initialized
@ -59,6 +64,11 @@ ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) defer(
* The function object is queued for execution, and is never called from the
* current thread prior to returning from <tt>defer()</tt>.
*
* The use of @c defer(), rather than @ref post(), indicates the caller's
* preference that the executor defer the queueing of the function object. This
* may allow the executor to optimise queueing for cases when the function
* object represents a continuation of the current call context.
*
* This function has the following effects:
*
* @li Constructs a function object handler of type @c Handler, initialized

View File

@ -28,8 +28,8 @@ namespace asio {
/// Submits a completion token or function object for execution.
/**
* This function submits an object for execution using the object's associated
* executor. The function object is queued for execution, and is never called
* from the current thread prior to returning from <tt>dispatch()</tt>.
* executor. The function object may be called from the current thread prior to
* returning from <tt>dispatch()</tt>. Otherwise, it is queued for execution.
*
* This function has the following effects:
*
@ -56,8 +56,8 @@ ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) dispatch(
/// Submits a completion token or function object for execution.
/**
* This function submits an object for execution using the specified executor.
* The function object is queued for execution, and is never called from the
* current thread prior to returning from <tt>dispatch()</tt>.
* The function object may be called from the current thread prior to returning
* from <tt>dispatch()</tt>. Otherwise, it is queued for execution.
*
* This function has the following effects:
*

View File

@ -31,6 +31,9 @@ namespace asio {
* executor. The function object is queued for execution, and is never called
* from the current thread prior to returning from <tt>post()</tt>.
*
* The use of @c post(), rather than @ref defer(), indicates the caller's
* preference that the function object be eagerly queued for execution.
*
* This function has the following effects:
*
* @li Constructs a function object handler of type @c Handler, initialized
@ -59,6 +62,9 @@ ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
* The function object is queued for execution, and is never called from the
* current thread prior to returning from <tt>post()</tt>.
*
* The use of @c post(), rather than @ref defer(), indicates the caller's
* preference that the function object be eagerly queued for execution.
*
* This function has the following effects:
*
* @li Constructs a function object handler of type @c Handler, initialized

View File

@ -58529,6 +58529,8 @@ Submits a completion token or function object for execution.
This function submits an object for execution using the object's associated executor. The function object is queued for execution, and is never called from the current thread prior to returning from `defer()`.
The use of `defer()`, rather than [link asio.reference.post `post`] , indicates the caller's preference that the executor defer the queueing of the function object. This may allow the executor to optimise queueing for cases when the function object represents a continuation of the current call context.
This function has the following effects:
@ -58573,6 +58575,8 @@ Submits a completion token or function object for execution.
This function submits an object for execution using the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `defer()`.
The use of `defer()`, rather than [link asio.reference.post `post`] , indicates the caller's preference that the executor defer the queueing of the function object. This may allow the executor to optimise queueing for cases when the function object represents a continuation of the current call context.
This function has the following effects:
@ -58756,7 +58760,7 @@ Submits a completion token or function object for execution.
CompletionToken && token);
This function submits an object for execution using the object's associated executor. The function object is queued for execution, and is never called from the current thread prior to returning from `dispatch()`.
This function submits an object for execution using the object's associated executor. The function object may be called from the current thread prior to returning from `dispatch()`. Otherwise, it is queued for execution.
This function has the following effects:
@ -58800,7 +58804,7 @@ Submits a completion token or function object for execution.
typename enable_if< is_executor< Executor >::value >::type * = 0);
This function submits an object for execution using the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `dispatch()`.
This function submits an object for execution using the specified executor. The function object may be called from the current thread prior to returning from `dispatch()`. Otherwise, it is queued for execution.
This function has the following effects:
@ -98100,6 +98104,8 @@ Submits a completion token or function object for execution.
This function submits an object for execution using the object's associated executor. The function object is queued for execution, and is never called from the current thread prior to returning from `post()`.
The use of `post()`, rather than [link asio.reference.defer `defer`] , indicates the caller's preference that the function object be eagerly queued for execution.
This function has the following effects:
@ -98144,6 +98150,8 @@ Submits a completion token or function object for execution.
This function submits an object for execution using the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `post()`.
The use of `post()`, rather than [link asio.reference.defer `defer`] , indicates the caller's preference that the function object be eagerly queued for execution.
This function has the following effects: