diff options
| author | William Boman <william@redwill.se> | 2026-05-22 20:14:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-22 20:14:45 +0200 |
| commit | 24e77d5289db0f7b6f4b405683047315b66dc75b (patch) | |
| tree | 1d40c97d129c8d621d9c9d0645c7c268b49505b2 /lua/mason-core/installer/InstallRunner.lua | |
| parent | feat(registry): add registry_cache setting for controlling cache behaviour (#... (diff) | |
| download | mason-24e77d5289db0f7b6f4b405683047315b66dc75b.tar mason-24e77d5289db0f7b6f4b405683047315b66dc75b.tar.gz mason-24e77d5289db0f7b6f4b405683047315b66dc75b.tar.bz2 mason-24e77d5289db0f7b6f4b405683047315b66dc75b.tar.lz mason-24e77d5289db0f7b6f4b405683047315b66dc75b.tar.xz mason-24e77d5289db0f7b6f4b405683047315b66dc75b.tar.zst mason-24e77d5289db0f7b6f4b405683047315b66dc75b.zip | |
feat: add support for socket.dev firewall client (#2088)
Diffstat (limited to 'lua/mason-core/installer/InstallRunner.lua')
| -rw-r--r-- | lua/mason-core/installer/InstallRunner.lua | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lua/mason-core/installer/InstallRunner.lua b/lua/mason-core/installer/InstallRunner.lua index 3eba879a..336f0c93 100644 --- a/lua/mason-core/installer/InstallRunner.lua +++ b/lua/mason-core/installer/InstallRunner.lua @@ -39,7 +39,14 @@ function InstallRunner:execute(opts, callback) local handle = self.handle log.fmt_info("Executing installer for %s %s", handle.package, opts) - local context = InstallContext:new(handle, opts) + local context = InstallContext:new(handle, opts, { + suspend = function() + self:suspend() + end, + resume = function() + self:resume() + end, + }) local tailed_output = {} @@ -212,6 +219,20 @@ function InstallRunner:acquire_permit() return Result.success(channel) end +function InstallRunner:suspend() + if self.global_permit then + self.global_permit:forget() + self.global_permit = nil + end +end + +---@async +function InstallRunner:resume() + self.handle:set_state "QUEUED" + self.global_permit = self.global_semaphore:acquire() + self.handle:set_state "ACTIVE" +end + ---@private function InstallRunner:release_permit() if self.global_permit then |
