Hi

Am 2025-11-19 16:19, schrieb Edmond Dantes:
I'm afraid to note that the proposed API is in violation of our policy regarding Throwables
Thank you. It was fixed.

That is not quite right. The base exception should be `\Async\AsyncException`. I am also noticing that you changed the `DeadlockError` to `DeadlockException` which is a significant change from the previous proposal. The Error hierarchy is meant for problems that are not expected to be caught, because they cannot usefully be handled. The Exception hierarchy is something that should be caught.

Given that the RFC says (highlighting mine):

This condition is called a Deadlock, and it represents a **serious logical error**.

I believe it should be a `DeadlockError` like it originally proposed. That one should then extend `\Async\AsyncError` and similarly `\Async\AsyncError` should extend `\Error.

Similarly for `CancellationError`. It should extend `\Async\AsyncError`. I'm seeing the comment “Does not extend Exception to avoid accidental suppression” which makes sense to me, but the Error hierarchy specifically isn't an Exception. And folks catching `\Throwable` will catch `CancellationError` as well, so I don't see a reason why it should be treated differently in this regard.

------------

Looking at the stub more carefully, I'm also seeing that `\Async\gracefulShutdown()` should be `\Async\graceful_shutdown()` instead (and similarly for `currentCoroutine()` -> `current_coroutine()` and `getCoroutines()` -> `get_coroutines()`). This is something that I could have caught earlier and I'm sorry that I did not. However since changes to the RFC will still be required (which means that the vote will need to be cancelled), it probably makes sense to fix that as well.

Best regards
Tim Düsterhus

Reply via email to