Op di 25 nov 2025 om 10:43 schreef Edmond Dantes <[email protected]>:

> Hello
>
> > Susie doesn't know anything about the implementation, other than what is
> defined in the interface. That is literally the purpose of accepting an
> interface.
> > So it sounds like her only safe option is to restrict her usage of async
> coroutines to small self-contained pieces of code, and only use injected
> dependencies and callbacks in the "main" coroutine where they were passed
> in.
>
> Exactly. This means that for asynchronous logging, a separate
> interface must be introduced in order to guarantee correct behavior.
>

In my opinion that depends on what Susie thinks of as correct behavior, but
LoggerInterface might not be the best example to discuss shared state.
There's plenty of other examples to think of though that would not
guarantee backwards compatibility (order of lines in a file written with
file_put_contents etc).

Anyway, it seems like we're coming to the conclusion that mixing sync and
async behavior is going to cause quite some problems and is something that
would not pass a vote if I had to guess. Even if you know what you're doing
YMMV.

Am I reading the room correctly if I say that we're converging at the
sync/async toggle (ini settings, function call, whatever, ...)?

Best Regards,
Bart Vanhoutte

Reply via email to