Skip to content

Commit

Permalink
remove assert dur to user can use there ioc
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Jan 17, 2025
1 parent cbded56 commit 59e5ef8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions include/ylt/coro_rpc/impl/coro_rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,8 @@ class coro_rpc_client {
auto future = p->getFuture();
asio::dispatch(control->executor_.get_asio_executor(),
[control, p = std::move(p)]() {
assert(&control->executor_.get_asio_executor().context() ==
&control->socket_.get_executor().context());
p->setValue(close_socket(std::move(control)));
});
future.wait();
Expand All @@ -741,15 +743,8 @@ class coro_rpc_client {
return {};
}

static async_simple::coro::Lazy<bool> check_work_in_io_context(
std::shared_ptr<coro_rpc_client::control_t> &control) {
auto executor = co_await coro_io::get_current_executor();
co_return executor == control->executor_;
}
static std::error_code close_socket(
std::shared_ptr<coro_rpc_client::control_t> control) {
assert(*coro_io::get_current() ==
&control->socket_.get_executor().context());
control->has_closed_ = true;
bool expected = false;
asio::error_code ec;
Expand Down

0 comments on commit 59e5ef8

Please sign in to comment.