Skip to content

Commit

Permalink
main_ioc.post 替换为 asio::post(main_ioc,
Browse files Browse the repository at this point in the history
asio 一波更新,删了 ioc.post()
  • Loading branch information
microcai committed Dec 21, 2024
1 parent 04dbcfd commit 2bd8707
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test5/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ boost::asio::io_context main_ioc;
ucoro::awaitable<int> coro_compute_int(int value)
{
auto ret = co_await callback_awaitable<int>([value](auto handle) {
main_ioc.post([value, handle = std::move(handle)]() mutable {
boost::asio::post(main_ioc, [value, handle = std::move(handle)]() mutable {
std::this_thread::sleep_for(std::chrono::seconds(0));
std::cout << value << " value\n";

Expand Down
2 changes: 1 addition & 1 deletion tests/test_asio/test_asio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ boost::asio::awaitable<int> asio_coro_test()
ucoro::awaitable<int> coro_compute_int(int value)
{
auto ret = co_await callback_awaitable<int>([value](auto handle) {
main_ioc.post([value, handle = std::move(handle)]() mutable {
boost::asio::post(main_ioc, [value, handle = std::move(handle)]() mutable {
std::this_thread::sleep_for(std::chrono::seconds(0));
std::cout << value << " value\n";
handle(value * 100);
Expand Down

0 comments on commit 2bd8707

Please sign in to comment.