Re: Capy Review

Vinnie Falco via Boost <[email protected]> Thu, 25 Jun 2026 13:54:57 -0700
Newsgroups gmane.comp.lib.boost.devel
Message-ID <CA+EzHGeMf=rQaa1LOVBvsHSGXNuoCAMK+JvnB6RxrSFYq7trgA@mail.gmail.com>
On Thu, Jun 25, 2026 at 6:11 AM Vinnie Falco <[email protected]> wrote:

> On Thu, Jun 25, 2026 at 4:56 AM Rainer Deyke via Boost <
> [email protected]> wrote:
>
>> Pretty sure that's not actually true.
>
>
> Capy provides an execution model for coroutines which offers one simple
> invariant:
>
>     A coroutine will always be resumed by the same Executor object which
> was used to launch it.
>

I need to clarify this because Seth pointed out that Asio's invariant isn't
exactly this in all cases. The above is Asio's default behavior, without
using bind_executor. Every plain co_await inside asio's awaitable resumes
on the coroutine's associated executor. This is the default completion
token path, and it has an escape hatch if you opt out via bind_executor.

Capy makes Asio's default behavior mandatory, and omits the escape hatch
deliberately. The escape hatch can still be implemented - IoAwaitable is a
concept, and users are both able and encouraged to author their own task
types when doing so provides advantages for their domain.

Thanks
_______________________________________________
Boost mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.boost.org/mailman3/lists/boost.lists.boost.org/
Archived at: https://lists.boost.org/archives/list/[email protected]/message/SPS2LTRVYQA7R4OJTFXXG5II3AJEZIQM/