reproxypid

package
v0.0.0-...-223af15 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Proxyname is the name of the RE proxy process.
	Proxyname = "reproxy"
)

Variables

This section is empty.

Functions

func WriteFile

func WriteFile(serverAddr string, pid int) error

WriteFile writes the pid file for the reproxy process running at serverAddr.

Types

type File

type File struct {
	Pid int
	// contains filtered or unexported fields
}

File represents a file that stores the pid of a running reproxy process.

func ReadFile

func ReadFile(serverAddr string) (*File, error)

ReadFile reads the pid file for the reproxy process running at serverAddr.

func (*File) Delete

func (f *File) Delete()

Delete this pid file. Supresses and logs errors as it is ok if the file as already been cleaned up.

func (*File) IsAlive

func (f *File) IsAlive() (bool, error)

IsAlive retuns true if the reproxy process is still running.

func (*File) PollForDeath

func (f *File) PollForDeath(ctx context.Context, pollDelay time.Duration, deadCh chan error)

PollForDeath will poll pid from f every pollDelay and send nil to deadCh when that pid is no longer alive, the pid file will then be deleted. If an error is encountered in checking the process then it will be send to deadCh and this function will end and the pid file will not be deleted. Meant to be called in a go routine.

Jump to

Keyboard shortcuts

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