-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coroutines + asio #127
Comments
Hi, thanks for the request. We are currently do not use Coroutines Ts and haven't try it yet. The library is designed in the way to support all types of asynchronous IO what Boost.Asio supports via its completion tokens. Coroutines Ts is supported via If you would have any techincal problems trying to use |
Well... its a bit tricky. /home/user/work/ozo/contrib/resource_pool/include/yamail/resource_pool/async/detail/pool_impl.hpp:350:7: error: no member named 'handler_type' in namespace 'boost::asio'; did you mean as i can see you are using deprecated feature. Failed to look further. Im able to use 1.66 from source, but i hope it would be fixed for 1.70+. Thanks in advance. By the way everething is cool under Visual Studio 2017+.. except you are using non standard c++ gnu extesions.. (I mean literal templates|udl magic etc), and i cant handle it there. But i saw in hana sources that udl macro can be replaced with another .. cant put it here right know. Arrghh.. Problems everywhere..) |
Thank you for trying the library with different build configuration.
IMO the problem is because of incorrect support of Boost's old versions in the resource_pool library. Could you try to change this part to #if BOOST_VERSION < 106600
using boost::asio::async_result;
using boost::asio::handler_type; And it seems like you would have to make something about So if it works well for you then feel free to create a corresponding PRs for resource_pool and OZO.
We do not use VS and do not have plans to support it in the nearest future. But you are always welcome to make a PR. If it is OK and does not affect Linux and macOS builds it would have a good chance to be merged into master. |
For boost 1.70 |
Thanks for the remark! |
Iv managed to get it work with 1.70. Iv changed 2 files as was mentioned - pool_impl.hpp & connection.h
But changed example with coroutines failed to build
Here is build log
Sorry if iv done something wrong |
try
|
Well.. almost the same..
|
As for me it looks like you’ve missed to include some header with specialized async_result for the Coroutine TS .I’m on vacation until 13 May, so my ability to help is limited for now.BTW, I think it would be better to fork the project, make a branch with your changes and put a link on the branch here. Or even better, make a draft PR. It will give an ability to try your code as it is and in case of success make a complete PR in the project.
|
@thed636 Ok. Il do PR with test code. But i dont think that error in absent includes.
I think that it wouldnt work with use_awaitable token (but i hope it does and im just wrong somewhere =)) |
It looks like wrong version of async_result is used.
https://www.boost.org/doc/libs/1_70_0/doc/html/boost_asio/history.html |
@kirillv I'v made some investigation which led me to bad news. Sorry, I was too optimistic in my belief of It seems like you can not use Coroutines TS with It seems like the shortest and easiest way for you is to use Of course, you can provide PR with additional support of That's how it is. |
@kirillv I’ve prototyped the possible approach with boost::asio::async_initiate() implementation which is described in my previous message for the ozo::get_connection() function. Looks like it works, so you could try it. |
@kirillv could you please to try to experiment with try_with_gorroutines branch which is based on my recent changes for the upcoming failover framework? I've added basic support of |
@thed636 sorry for not replying. i was on vacation. ill check this branch |
Well.. iv got such build error with this branch and fixes for 1.70 that was made in recent
|
@thed636 hi! any news about possible build fixes? |
@kirillv Hi! It is not necessary to wait for some trivial fixes from me. I showed how |
@kirillv are you still interested in this issue? |
@thed636 |
No examples with coroutines_ts. If it possible to use your library with co_await etc it would be great (dont like callback hell even with lamdas).
The text was updated successfully, but these errors were encountered: