Boost C++ Libraries

PrevUpHomeNext

Type definition rebind_executor

rebind_executor — Rebind an Asio I/O object to taar's default executor and completion token.

Synopsis

// In header: <boost/taar/core/rebind_executor.hpp>


template<typename T> 
using rebind_executor = typename T::template rebind_executor< boost::asio::as_tuple_t< boost::asio::use_awaitable_t< boost::asio::any_io_executor > >::executor_with_default< boost::asio::any_io_executor > >::other;

Description

Given an Asio I/O object type T (e.g. tcp::socket, beast::tcp_stream, tcp::acceptor), this alias produces the corresponding type using any_io_executor and bound to the boost::taar::use_awaitable_tuple completion token. The result is the type Taar's coroutines use internally for library-private objects (resolver, acceptor), where returning (error_code, result) by default is convenient; it is also handy for client sockets in user code.

Public handler types do not use it: session handlers receive a plain boost::asio::ip::tcp::socket, and raw handlers a plain boost::beast::tcp_stream (or session::tls_stream, a plain boost::beast::ssl_stream<boost::beast::tcp_stream>).


PrevUpHomeNext