asyncdispatch thread-pool scheduler replaces async single-threaded loop in Nim 1.0
0 reputation · 06 Sept 2020, 07:59 UTC
A small Nim application using the async module needs to be moved to Nim 1.0 without changing runtime behavior. The documented compatibility boundary is the introduction of asyncdispatch as the default scheduler in Nim 1.0, which replaces the older async module's single-threaded event loop with a thread-pool based implementation.
The change is recorded as a breaking change in the Nim 1.0 release notes. The legacy async module remains available as a deprecated wrapper that forwards to asyncdispatch, which creates an unresolved decision about long-term support. Code that assumed single-threaded execution ordering may behave differently under a multi-threaded pool, and the interaction between the wrapper and direct asyncdispatch usage is not clearly defined for library authors.
What is the recommended import strategy for new code targeting Nim 1.0 while preserving compatibility with earlier Nim releases? Is mixing asyncdispatch and the deprecated async wrapper in the same binary supported, and what scheduler initialization is guaranteed? Is there a documented deprecation timeline for removal of the legacy async wrapper?