-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Async ops now support cancel_after and similar tokens
All initiations have now an associated executor. close #330
- Loading branch information
Showing
7 changed files
with
216 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// Copyright (c) 2019-2024 Ruben Perez Hidalgo (rubenperez038 at gmail dot com) | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
|
||
#ifndef BOOST_MYSQL_DETAIL_ASYNC_HELPERS_HPP | ||
#define BOOST_MYSQL_DETAIL_ASYNC_HELPERS_HPP | ||
|
||
#include <boost/asio/any_io_executor.hpp> | ||
|
||
namespace boost { | ||
namespace mysql { | ||
namespace detail { | ||
|
||
// Base class for initiation objects. Includes a bound executor, so they're compatible | ||
// with asio::cancel_after and similar | ||
struct initiation_base | ||
{ | ||
asio::any_io_executor ex; | ||
|
||
initiation_base(asio::any_io_executor ex) noexcept : ex(std::move(ex)) {} | ||
|
||
using executor_type = asio::any_io_executor; | ||
const executor_type& get_executor() const noexcept { return ex; } | ||
}; | ||
|
||
} // namespace detail | ||
} // namespace mysql | ||
} // namespace boost | ||
|
||
#endif |
Oops, something went wrong.