Editorial question123.8K views4,251 votes0 answers924 following
AI-generatedstd/asyncdispatch and std/threadpool: Awaiting a FlowVar Without Stalling the Event Loop
I am designing a Nim service where async request handlers (std/asyncdispatch) occasionally need to call a legacy blocking library. The documented escape hatch is std/threadpool's spawn, which returns a FlowVar[T], but a FlowVar cannot be awaited natively inside an async procedure. The options appear to be polling isReady in a loop with sleepAsync, blocking o