[PR #410] Async Task Interface for long running functions #446

Open
opened 2026-02-28 00:42:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/410
Author: @Tinyblargon
Created: 4/3/2025
Status: 🔄 Open

Base: masterHead: #388-2


📝 Commits (7)

  • 0f17283 feat: new task handler
  • eddb282 feat: dummyTask with feature flag
  • f9394db refactor: use Task interface
  • d21b934 fix: task logs test
  • 08ab6ac test: task cleanup on error
  • 2685d5c Hide LogStream() as it lacks testing
  • 20ea37b docs: Task fature flag information.

📊 Changes

21 files changed (+1121 additions, -137 deletions)

View changed files

📝 cli/command/content/iso/download.go (+4 -1)
📝 cli/command/content/template/download.go (+4 -1)
📝 cli/command/create/create-snapshot.go (+4 -1)
📝 cli/command/delete/delete-file.go (+4 -1)
📝 cli/command/delete/delete.go (+6 -1)
internal/atomicerror/atomicerror.go (+33 -0)
internal/notify/notify.go (+28 -0)
📝 main.go (+2 -1)
📝 proxmox/client.go (+124 -37)
📝 proxmox/config_guest.go (+10 -11)
📝 proxmox/config_qemu.go (+29 -9)
📝 proxmox/config_qemu_disk.go (+9 -3)
📝 proxmox/content.go (+4 -4)
📝 proxmox/content_iso.go (+4 -4)
📝 proxmox/content_template.go (+2 -3)
📝 proxmox/snapshot.go (+21 -26)
proxmox/task.go (+523 -0)
proxmox/task_test.go (+271 -0)
📝 proxmox/vmref.go (+31 -30)
📝 proxmox/vmref_test.go (+4 -2)

...and 1 more files

📄 Description

Adds a Task interface that can be used for asynchronously awaiting the completion of the task.

The async part is enabled with the Features.AsyncTask flag in the Client struct.

Resolves #388

Supersedes:
Closes #397
Closes #389


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/410 **Author:** [@Tinyblargon](https://github.com/Tinyblargon) **Created:** 4/3/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `#388-2` --- ### 📝 Commits (7) - [`0f17283`](https://github.com/Telmate/proxmox-api-go/commit/0f17283a91fa54ef16499d28caa04ea2f1835b2a) feat: new task handler - [`eddb282`](https://github.com/Telmate/proxmox-api-go/commit/eddb2823892f7cd6ee88459109f5a71c043524cb) feat: `dummyTask` with feature flag - [`f9394db`](https://github.com/Telmate/proxmox-api-go/commit/f9394dbb81c250836bb9f1abf996872fd718d71d) refactor: use `Task` interface - [`d21b934`](https://github.com/Telmate/proxmox-api-go/commit/d21b934e714dcd8a3d9930cd63f6461ab88a7a78) fix: task logs test - [`08ab6ac`](https://github.com/Telmate/proxmox-api-go/commit/08ab6ac2496b49e2c914681856d2d88843b6be3f) test: task cleanup on error - [`2685d5c`](https://github.com/Telmate/proxmox-api-go/commit/2685d5c29721a074b7cba4762515ff026251cf11) Hide `LogStream()` as it lacks testing - [`20ea37b`](https://github.com/Telmate/proxmox-api-go/commit/20ea37b07a4937a9af3bb38bbb57dfa69696d026) docs: Task fature flag information. ### 📊 Changes **21 files changed** (+1121 additions, -137 deletions) <details> <summary>View changed files</summary> 📝 `cli/command/content/iso/download.go` (+4 -1) 📝 `cli/command/content/template/download.go` (+4 -1) 📝 `cli/command/create/create-snapshot.go` (+4 -1) 📝 `cli/command/delete/delete-file.go` (+4 -1) 📝 `cli/command/delete/delete.go` (+6 -1) ➕ `internal/atomicerror/atomicerror.go` (+33 -0) ➕ `internal/notify/notify.go` (+28 -0) 📝 `main.go` (+2 -1) 📝 `proxmox/client.go` (+124 -37) 📝 `proxmox/config_guest.go` (+10 -11) 📝 `proxmox/config_qemu.go` (+29 -9) 📝 `proxmox/config_qemu_disk.go` (+9 -3) 📝 `proxmox/content.go` (+4 -4) 📝 `proxmox/content_iso.go` (+4 -4) 📝 `proxmox/content_template.go` (+2 -3) 📝 `proxmox/snapshot.go` (+21 -26) ➕ `proxmox/task.go` (+523 -0) ➕ `proxmox/task_test.go` (+271 -0) 📝 `proxmox/vmref.go` (+31 -30) 📝 `proxmox/vmref_test.go` (+4 -2) _...and 1 more files_ </details> ### 📄 Description Adds a `Task` interface that can be used for asynchronously awaiting the completion of the task. The async part is enabled with the `Features.AsyncTask` flag in the `Client` struct. Resolves #388 Supersedes: Closes #397 Closes #389 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#446
No description provided.