mirror of
https://github.com/neovim/neovim.git
synced 2026-09-04 13:20:34 +00:00
feat(lua): add vim.async
Problem: Nvim has many Lua APIs that start callback-driven work: timers, jobs, libuv handles, and other event-loop tasks. Callers that need to sequence or cancel that work have to build their own coroutine wrappers, task bookkeeping, and cleanup rules. This makes async control flow hard to share, test, and document. Solution: Add `vim.async`, a structured-concurrency module vendored from async.nvim. It provides task handles, await/pawait helpers, sleep/timeout helpers, completion-order iteration, and semaphores on top of Nvim's event loop. The API follows the same broad model as Trio: async work has an owner, tasks are awaited explicitly, and cancellation is cooperative. Include generated vimdoc with an introductory overview and examples, a news entry, and functional tests for the new module. AI-assisted
This commit is contained in:
committed by
Lewis Russell
parent
da4355ab8f
commit
ce8a897f98
2687
test/functional/lua/async_spec.lua
Normal file
2687
test/functional/lua/async_spec.lua
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user