Boost logo

Boost Users :

From: Richard Hodges (hodges.r_at_[hidden])
Date: 2023-12-07 05:13:02


On Wed, 6 Dec 2023 at 23:35, Keith Bennett via Boost-users <
boost-users_at_[hidden]> wrote:

>
>
> On Wed, Dec 6, 2023 at 9:20 AM Richard Hodges via Boost-users <
> boost-users_at_[hidden]> wrote:
>
>> Anyway... you could create a `boost::asio::experimental::basic_channel`
>>> using the signature `(void)` and then `co_await` the channel to suspend the
>>> coroutine. Later when you want to wake it up, send a message to the channel
>>> from elsewhere. You will need to be thoughtful about the order of how
>>> things are destroyed if you want to tear down the socket (or corresponding
>>> I/O object). More here:
>>>
>>>
>>> https://www.boost.org/doc/libs/1_83_0/doc/html/boost_asio/reference/experimental__basic_channel.html
>>>
>>>
>> This is actually Chris' recommended solution. It's so new I forgot about
>> it. :)
>>
>
> Ahh it's still experimental in 1.83.0. I'd rather avoid experimental
> things for now. I look forward to it coming out of experimental.
>

Channels are robust. Chris is a fan of them. I think it’s fair to say that
he sees every async-concurrency synchronisation primitive being implemented
with some configuration of a channel.

>
> --
> Keith Bennett
>
> _______________________________________________
> 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