refactor
This commit is contained in:
@@ -110,13 +110,12 @@ void run_with_deadline(boost::asio::io_context &io_ctx, op_t &&operation,
|
||||
|
||||
boost::asio::steady_timer timer{io_ctx};
|
||||
timer.expires_after(deadline);
|
||||
timer.async_wait(
|
||||
[&cancel_op, &done, &timed_out](const boost::system::error_code &err_) {
|
||||
if (not err_ && not done) {
|
||||
timed_out = true;
|
||||
cancel_op();
|
||||
}
|
||||
});
|
||||
timer.async_wait([&cancel_op, &done, &timed_out](auto &&err_) {
|
||||
if (not err_ && not done) {
|
||||
timed_out = true;
|
||||
cancel_op();
|
||||
}
|
||||
});
|
||||
|
||||
boost::system::error_code err{};
|
||||
operation([&done, &err](auto &&err_) {
|
||||
|
Reference in New Issue
Block a user