monitor

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: UPL-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundFunc

type BackgroundFunc func() error

BackgroundFunc - the operation to be called in the background goroutine

type BackgroundProcessMonitor

type BackgroundProcessMonitor interface {
	// CheckResult - Checks for a result from the goroutine; returns either the result of the operation, or an error indicating
	// the operation is still in progress
	CheckResult() (bool, error)
	// Reset - Resets the monitor and closes any open channels
	Reset()
	// IsRunning - returns true of the monitor/goroutine are active
	IsRunning() bool
	// IsCompleted - returns true if the monitor has run and marked as completed
	IsCompleted() bool
	// SetCompleted - sets the monitor thread to true
	SetCompleted()
	// Run - Run the operation with the specified args in a background goroutine
	Run(operation BackgroundFunc)
}

BackgroundProcessMonitor - Represents a monitor object used by the component to monitor a background goroutine used for running install, uninstall, etc. operations asynchronously.

type BackgroundProcessMonitorType

type BackgroundProcessMonitorType struct {
	ComponentName string
	// contains filtered or unexported fields
}

BackgroundProcessMonitorType - a monitor. &BackgroundProcessMonitorType acts as an implementation of BackgroundProcessMonitor

func (*BackgroundProcessMonitorType) CheckResult

func (m *BackgroundProcessMonitorType) CheckResult() (bool, error)

CheckResult - checks for a result from the goroutine - returns false and a retry error if it's still running, or the result from the channel and nil if an answer was received

func (*BackgroundProcessMonitorType) IsCompleted added in v1.5.2

func (m *BackgroundProcessMonitorType) IsCompleted() bool

IsCompleted - returns true if the monitor/goroutine is completed

func (*BackgroundProcessMonitorType) IsRunning

func (m *BackgroundProcessMonitorType) IsRunning() bool

IsRunning - returns true if the monitor/goroutine are active

func (*BackgroundProcessMonitorType) Reset

func (m *BackgroundProcessMonitorType) Reset()

Reset - reset the monitor and close the channel

func (*BackgroundProcessMonitorType) Run

func (m *BackgroundProcessMonitorType) Run(operation BackgroundFunc)

Run - calls the operation in a background goroutine

func (*BackgroundProcessMonitorType) SetCompleted added in v1.5.2

func (m *BackgroundProcessMonitorType) SetCompleted()

SetCompleted - sets the monitor thread as completed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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