boost version 1.86 support
Added fix for boost::asio::spawn overload issue reported similar
to chriskohlhoff/asio#1524. This error reported by CI build during
boost version bump.
Error details
'''
../example/asio-example.cpp:375:23:
error: call of overloaded ‘spawn(boost::asio::io_context&, client()::<lambda(boost::asio::yield_context)>)’ is ambiguous
375 | boost::asio::spawn(io, [conn](boost::asio::yield_context yield) {
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
376 | do_start_async_method_call_one(conn, yield);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
377 | });
| ~~
In file included from /usr/local/include/boost/asio/spawn.hpp:871,
from ../example/asio-example.cpp:2:
'''
Proposed fix is to explicitly specify the completion token.
Tested: verified build
Change-Id: I5ec16f8f33c617a6abc823abf75b765c0d031141
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
index f5f0176..145e87a 100644
--- a/example/asio-example.cpp
+++ b/example/asio-example.cpp
@@ -1,3 +1,4 @@
+#include <boost/asio/detached.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/spawn.hpp>
#include <sdbusplus/asio/connection.hpp>
@@ -372,15 +373,24 @@
// set up a client to make an async call to the server
// using coroutines (userspace cooperative multitasking)
- boost::asio::spawn(io, [conn](boost::asio::yield_context yield) {
- do_start_async_method_call_one(conn, yield);
- });
- boost::asio::spawn(io, [conn](boost::asio::yield_context yield) {
- do_start_async_ipmi_call(conn, yield);
- });
- boost::asio::spawn(io, [conn](boost::asio::yield_context yield) {
- do_start_async_to_yield(conn, yield);
- });
+ boost::asio::spawn(
+ io,
+ [conn](boost::asio::yield_context yield) {
+ do_start_async_method_call_one(conn, yield);
+ },
+ boost::asio::detached);
+ boost::asio::spawn(
+ io,
+ [conn](boost::asio::yield_context yield) {
+ do_start_async_ipmi_call(conn, yield);
+ },
+ boost::asio::detached);
+ boost::asio::spawn(
+ io,
+ [conn](boost::asio::yield_context yield) {
+ do_start_async_to_yield(conn, yield);
+ },
+ boost::asio::detached);
conn->async_method_call(
[](boost::system::error_code ec, int32_t testValue) {