aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/installer/InstallRunner.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2026-05-22 20:14:45 +0200
committerGitHub <noreply@github.com>2026-05-22 20:14:45 +0200
commit24e77d5289db0f7b6f4b405683047315b66dc75b (patch)
tree1d40c97d129c8d621d9c9d0645c7c268b49505b2 /lua/mason-core/installer/InstallRunner.lua
parentfeat(registry): add registry_cache setting for controlling cache behaviour (#... (diff)
downloadmason-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.lua23
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