You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: Optimize MachineList command to fetch machines and default status concurrently #2212
In Sources/ContainerCommands/Machine/MachineList.swift, the run() method currently fetches the list of machines (client.list()) and the default machine (client.getDefault()) sequentially.
Using Swift's concurrency (async let), these two asynchronous operations can be executed in parallel to improve command performance and reduce execution latency.
Proposed Solution
Update the run() function to fetch both parameters concurrently:
publicfuncrun()asyncthrows{letclient=MachineClient()asyncletmachinesTask=client.list()asyncletdefaultMachineTask=client.getDefault()letmachines=tryawaitmachinesTaskifself.quiet{machines.forEach{print($0.id)}return}letdefaultMachine=tryawaitdefaultMachineTasktryprintMachines(machines:machines,format:format,defaultMachine:defaultMachine)}
### Code of Conduct
-[x] I agree to follow this project's Code of Conduct
Activity
kavix commentedon Aug 29, 2026
Love to work on this issue