Skip to content

Remove all nested waitFor - #446

Merged
nitely merged 10 commits into
nim-lang:masterfrom
nitely:remove_nested_waitfor
Sep 15, 2026
Merged

nitely merged 10 commits into
nim-lang:masterfrom
nitely:remove_nested_waitfor

Conversation

@nitely

@nitely nitely commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Chronos does not support nested waitFor and in newer version it fails at compile time when possible. This removes all the waitFor by following this rule:

The way a waitFor is to be removed, is turning the function async (all the way up for caller of callers)
and provide a "sync" version if needed for fully sync paths (one that runs waitFor on it).
A fully sync path is one that is never at any point called inside an async function.
AsyncSpawn is fire and forget, it's not equivalent to waitFor. The equivalent to waitFor inside async is await.

@nitely
nitely force-pushed the remove_nested_waitfor branch from fbd70ee to 29a2b82 Compare September 15, 2026 00:37
@nitely
nitely marked this pull request as ready for review September 15, 2026 02:16
@nitely
nitely marked this pull request as draft September 15, 2026 03:02
@nitely
nitely marked this pull request as ready for review September 15, 2026 05:37
@nitely
nitely merged commit 269b153 into nim-lang:master Sep 15, 2026
4 checks passed
@nitely
nitely deleted the remove_nested_waitfor branch September 15, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant