watchdog

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

This package implements a watchdog to run alongside this MCP Server. As the MCP Server may start multiple external dependencies (e.g. MATLAB processes), in the event of forceful shutdown, this watchdog ensures proper termination and cleanup of the external dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggerFactory added in v0.3.0

type LoggerFactory interface {
	GetGlobalLogger() (entities.Logger, messages.Error)
}

type OSLayer

type OSLayer interface {
	Getppid() int
}

type OSSignaler

type OSSignaler interface {
	InterruptSignalChan() <-chan os.Signal
}

type ProcessHandler

type ProcessHandler interface {
	WatchProcessAndGetTerminationChan(processPid int) (<-chan struct{}, error)
	KillProcess(processPid int) error
}

type ServerFactory added in v0.4.0

type ServerFactory interface {
	New() (transport.Server, error)
}

type ServerHandlerFactory added in v0.4.1

type ServerHandlerFactory interface {
	Handler() (handler.Handler, error)
}

type SocketFactory added in v0.4.0

type SocketFactory interface {
	Socket() (socket.Socket, error)
}

type Watchdog

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

func New

func New(
	loggerFactory LoggerFactory,
	osLayer OSLayer,
	processHandler ProcessHandler,
	osSignaler OSSignaler,
	serverHandlerFactory ServerHandlerFactory,
	serverFactory ServerFactory,
	socketFactory SocketFactory,
) *Watchdog

func (*Watchdog) StartAndWaitForCompletion

func (w *Watchdog) StartAndWaitForCompletion(_ context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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