8000 Fix nodiscard warnings in sync client by dberlin · Pull Request #407 · eclipse-paho/paho.mqtt.cpp · GitHub
[go: up one dir, main page]

Skip to content

Fix nodiscard warnings in sync client #407

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

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/mqtt/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ class client : private callback
// Most are launched in a separate thread, for convenience, except
// message_arrived, for performance.
void connected(const string& cause) override {
std::async(std::launch::async, &callback::connected, userCallback_, cause);
std::async(std::launch::async, &callback::connected, userCallback_, cause).wait();
}
void connection_lost(const string& cause) override {
std::async(std::launch::async,
&callback::connection_lost, userCallback_, cause);
&callback::connection_lost, userCallback_, cause).wait();
}
void message_arrived(const_message_ptr msg) override {
userCallback_->message_arrived(msg);
}
void delivery_complete(delivery_token_ptr tok) override {
std::async(std::launch::async, &callback::delivery_complete, userCallback_, tok);
std::async(std::launch::async, &callback::delivery_complete, userCallback_, tok).wait();
}

/** Non-copyable */
Expand Down
0