watcher

package
v0.0.0-...-130d745 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcStatus

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

ProcStatus is a wrapper with the process state and an error in case there's any.

type ProcWatcher

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

ProcWatcher is a wrapper that act as a object that watches a process.

type Watcher

type Watcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Watcher is responsible for watching a list of processes and report to Master in case the process dies at some point.

func InitWatcher

func InitWatcher() *Watcher

InitWatcher will create a Watcher instance. Returns a Watcher instance.

func (*Watcher) AddProcWatcher

func (watcher *Watcher) AddProcWatcher(proc process.ProcContainer)

AddProcWatcher will add a watcher on proc.

func (*Watcher) RestartProc

func (watcher *Watcher) RestartProc() chan process.ProcContainer

RestartProc is a wrapper to export the channel restartProc. It basically keeps track of all the processes that died and need to be restarted. Returns a channel with the dead processes that need to be restarted.

func (*Watcher) StopWatcher

func (watcher *Watcher) StopWatcher(identifier string) chan bool

StopWatcher will stop a running watcher on a process with identifier 'identifier' Returns a channel that will be populated when the watcher is finally done.

Jump to

Keyboard shortcuts

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