Boost logo

Boost Users :

From: Richard Hodges (hodges.r_at_[hidden])
Date: 2021-06-06 18:00:18


The code means:

boost::asio::require( // #3
    io_context->get_executor(), // #1
    boost::asio::execution::outstanding_work.tracked) // #2

#1: given this executor,
#2: try to construct a similar executor which tracks the outstanding io
operations associated with it (i.e. does not stop until all work is
complete)
#3: require that this tracking attribute is available (fail to compile if
the executor does not support it)

On Sun, 6 Jun 2021 at 17:13, ZheNing Hu via Boost-users <
boost-users_at_[hidden]> wrote:

> Hi, I ran into difficulties when I was reading boost::asio http server
> example[1],
>
> I see:
>
> work_.push_back(
> boost::asio::require(io_context->get_executor(),
>
> boost::asio::execution::outstanding_work.tracked));
>
> I don't know what is the meaning of this code?
> Or what is boost::asio::require()? I did not find useful information
> to introduce it.
>
> [1]
> https://www.boost.org/doc/libs/1_76_0/doc/html/boost_asio/example/cpp03/http/server2/io_context_pool.cpp
>
> --
> ZheNing Hu
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net