Boost logo

Boost Users :

Subject: Re: [Boost-users] ASIO: Writing Composed Operations
From: Cristian Morales Vega (cristian_at_[hidden])
Date: 2019-01-25 15:50:28

On Thu, 6 Dec 2018 at 23:59, Damian Jarek <damian.jarek93_at_[hidden]> wrote:
> Here's an example of what might happen if a composed operation doesn't maintain work guards properly:
> Without the work_guard the coroutine never completes. If you add the work_guard, everything works correctly.

If I were to do something stupid like
- Hide executor_type making it private
- Use the handler executor type for the work guard

What would be the best way to unit test async_foo() to detect the problems?

I guess I could derive from io_context to get the steady_timer to use
an intermediate executor that would forward everything to the
io_context::get_executor but keeping record of the work count, and
bind a similar fake executor to check the dispatch calls. But there
may be a more clever/simpler way?

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at