taskpoller

package
v1.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Poller

type Poller struct {
	// contains filtered or unexported fields
}

Poller handles background task monitoring.

func New

func New(ctx context.Context, logger interfaces.Logger) *Poller

New creates a new task poller.

func (*Poller) AddTask

func (p *Poller) AddTask(client *api.Client, upid, node string, vmid int)

AddTask starts monitoring a task.

func (*Poller) GetActiveTasksForVM

func (p *Poller) GetActiveTasksForVM(vmid int) []*TaskInfo

GetActiveTasksForVM returns a list of active tasks for a specific VM.

func (*Poller) Stop

func (p *Poller) Stop()

Stop stops the poller.

func (*Poller) Subscribe

func (p *Poller) Subscribe(cb func(task *TaskInfo)) func()

Subscribe adds a callback for task updates and returns an unregister function.

type TaskInfo

type TaskInfo struct {
	UPID       string
	Node       string
	VMID       int
	Status     string
	ExitStatus string
	StartTime  time.Time
	// contains filtered or unexported fields
}

TaskInfo holds information about a monitored task.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL