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

Uses asio::deferred_t as default completion type. #228

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mzimbres
Copy link
Collaborator

No description provided.

@mzimbres mzimbres requested a review from anarthal December 23, 2024 21:11
@mzimbres mzimbres linked an issue Dec 23, 2024 that may be closed by this pull request
@mzimbres
Copy link
Collaborator Author

Hi @anarthal, does this fix the issue? Thanks.

@anarthal
Copy link
Collaborator

anarthal commented Dec 28, 2024

From what I read from my cell phone I'd say it does. I'm planning on reviewing it from my PC on Monday.

@anarthal
Copy link
Collaborator

I've left a couple of suggestions. They're not at all needed for this to work, you can do them if/whenever you want.

Also, I'd also write a couple of tests to cover that all the functions you changed successfully support the default token. That might be even a piece of code that you don't run, just to check it builds.

As I said, they're suggestions, the changes look good as they are.

template <class CompletionToken>
auto async_run(config const& cfg, logger l, CompletionToken token)
template <class CompletionToken = asio::deferred_t>
auto async_run(config const& cfg, logger l, CompletionToken token = {})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As minor comments, consider unifying all signatures using completion tokens to CompletionToken&&

@@ -1281,15 +1274,19 @@ class connection {
}

/// Calls `boost::redis::basic_connection::async_exec`.
template <class Response, class CompletionToken>
auto async_exec(request const& req, Response& resp, CompletionToken&& token)
template <class Response, class CompletionToken = asio::deferred_t>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also consider using BOOST_ASIO_COMPLETION_TOKEN_FOR to implement concept checks.

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

Successfully merging this pull request may close these issues.

Support default completion tokens in redis::connection
2 participants