Skip to content
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

Support asio::cancel_after #226

Open
anarthal opened this issue Dec 19, 2024 · 2 comments
Open

Support asio::cancel_after #226

anarthal opened this issue Dec 19, 2024 · 2 comments

Comments

@anarthal
Copy link
Collaborator

This is a very handy token, but it requires the initiation function object to have a bound executor. The following should work:

redis::connection conn (ctx);
co_await conn.async_exec(req, res, asio::cancel_after(10s));
@mzimbres
Copy link
Collaborator

I tried to implement cancelation for async_exec here:

if (is_cancelled(self)) {

At the moment I am considering removing as it is hard and I am not sure there is a good use cases for it. Do you think this is worth doing?

@anarthal
Copy link
Collaborator Author

anarthal commented Dec 22, 2024

Yes, there are good reasons. Without cancellation, you can't run a request with a timeout, for instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants