Skip to content

Commit

Permalink
doc: UseSender is no longer a function object and is no longer limite…
Browse files Browse the repository at this point in the history
…d to free functions of this library
  • Loading branch information
Tradias committed Apr 23, 2024
1 parent 2c7a6f7 commit aa86cf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/completion_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The last argument to all async functions in this library is a [CompletionToken](

## use_sender

`agrpc::use_sender` causes free functions in this library to return a [Sender](https://github.com/facebookexperimental/libunifex/blob/main/doc/concepts.md#typedsender-concept). They can for example be combined with `unifex::task` to asynchronously process RPCs using `co_await`. Note when using libunifex or stdexec exclusively then `agrpc::use_sender` is already the default completion token:
`agrpc::use_sender` causes functions in this library to return a [Sender](https://github.com/facebookexperimental/libunifex/blob/main/doc/concepts.md#typedsender-concept). They can for example be combined with `unifex::task` to asynchronously process RPCs using `co_await`. Note when using libunifex or stdexec exclusively then `agrpc::use_sender` is already the default completion token:

@snippet unifex_client.cpp unifex-server-streaming-client-side

Expand Down
11 changes: 4 additions & 7 deletions src/agrpc/use_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ AGRPC_NAMESPACE_BEGIN()
/**
* @brief Sender completion token
*
* This function object can be used to create completion tokens that cause free functions in this library to return a
* [sender](https://github.com/facebookexperimental/libunifex/blob/main/doc/concepts.md#typedsender-concept). This is
* particularly useful for libunifex where senders are also awaitable:
* This completion token causes functions in this library to return a
* [sender](https://github.com/facebookexperimental/libunifex/blob/main/doc/concepts.md#typedsender-concept).
* Particularly useful for libunifex where senders are also awaitable:
*
* @snippet unifex_client.cpp unifex-server-streaming-client-side
*
* For member functions in this library the `agrpc::UseSender` object must be used directly:
* @code{cpp}
* agrpc::ClientRPC<...>::request(..., agrpc::use_sender);
* @endcode
* Note when using libunifex or stdexec exclusively then `agrpc::use_sender` is already the default completion token.
*/
struct UseSender
{
Expand Down

0 comments on commit aa86cf2

Please sign in to comment.