|
cxxmcp 1.1.6
C++ MCP SDK
|
Public Types | |
| using | ResultType = core::Result< T > |
| using | CancelCallback = std::function< core::Result< core::Unit >(std::string reason)> |
Public Member Functions | |
| const protocol::RequestId & | request_id () const noexcept |
| const std::optional< std::chrono::milliseconds > & | timeout () const noexcept |
| const std::optional< CancellationToken > & | cancellation_token () const noexcept |
| core::Result< T > | await_response () const |
| Waits for the request result. | |
| core::Result< core::Unit > | cancel (std::string reason={}) const |
Static Public Member Functions | |
| static RequestHandle | ready (protocol::RequestId request_id, ResultType result) |
| Creates a handle whose result is already available. | |
| static RequestHandle | spawn (protocol::RequestId request_id, std::optional< std::chrono::milliseconds > timeout, std::optional< CancellationToken > cancellation, CancelCallback cancel, std::function< ResultType()> task) |
|
inline |
Waits for the request result.
CV-based, no polling.
If neither timeout nor cancellation was configured, blocks until the background task finishes. A configured cancellation token or timeout is observed: cancellation wakes the waiter immediately through the token's callback registration. Timeout uses AsyncResult::wait_for() which is CV-based.