You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the connection classes provide support to cancellation with cancel member function. Although not common or even advisable, some users may want to cancel operations with timeouts like this
This is working as long as the timeout is not too small e.g. 10ms. To handle that properly Aedis need to improve cancelation support. Below some parts of a conversation I've had with Richard
timer waits and IO reads will be cancellation-aware. But an operation that you have written yourself may not be.
also, If you cancel after posting an operation, when the posted code is executed, it may want to check whether the cancellation_state has been cancelled while the posted step was waiting in the executor.
// some code...asio::post(exec, some_next_step(std::move(my_handler));
// cancellation happens here...// some_next_step will not know that the handler was cancelled unless it checks.// ...// ... some_next_step now executes...
voidsome_next_step(auto handler)
{
auto cs = get_canecllation_state(handler);
if (cs.cancelled() != asio::cancellation_type::none)
{
complete(handler, operation_aborted);
return;
}
// ... not cancelled
}
The text was updated successfully, but these errors were encountered:
At the moment the
connection
classes provide support to cancellation withcancel
member function. Although not common or even advisable, some users may want to cancel operations with timeouts like thisco_await (conn.async_run(...) || timer.async_wait(...));
This is working as long as the timeout is not too small e.g.
10ms
. To handle that properly Aedis need to improve cancelation support. Below some parts of a conversation I've had with RichardThe text was updated successfully, but these errors were encountered: