kernel

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LowestPriority    = 10000
	LowPriority       = 1000
	MediumPriority    = 500
	HighPriority      = 100
	HighestPriority   = 50
	CriticalPriority  = 20
	ImmediatePriority = 1
)

Variables

This section is empty.

Functions

func RunKernel

func RunKernel(options ...Option)

Types

type Kernel

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

func NewDefaultKernel

func NewDefaultKernel(ctx context.Context, cores int, heapOverflow int) *Kernel

func (*Kernel) ID

func (kernel *Kernel) ID() string

func (*Kernel) RegisterRecovers

func (kernel *Kernel) RegisterRecovers() func()

func (*Kernel) RegisterShutdown

func (kernel *Kernel) RegisterShutdown(name string, fn func(), priority int)

func (*Kernel) RegisterWatchdogsLeadership

func (kernel *Kernel) RegisterWatchdogsLeadership(supervisor *LeaderSupervisor)

func (*Kernel) Run

func (kernel *Kernel) Run()

func (*Kernel) Start

func (kernel *Kernel) Start(cancel context.CancelFunc)

func (*Kernel) StartWatchdogsLeadership

func (kernel *Kernel) StartWatchdogsLeadership()

func (*Kernel) Stop

func (kernel *Kernel) Stop()

type KernelConfig

type KernelConfig struct {
	KernelId     string
	Cores        int
	HeapOverflow int
}

type LeaderSupervisor

type LeaderSupervisor struct {
	Watcher        <-chan int
	Start          func()
	Stop           func()
	Watchdog       watchdog.LeaderElectingWatchdog
	SupervisorName string

	Working bool
	// contains filtered or unexported fields
}

type Option

type Option func(krl *Kernel)

func WithConfigs

func WithConfigs(config KernelConfig) Option

func WithExecution

func WithExecution(execution func(ctx context.Context, kernel *Kernel) error) Option

Jump to

Keyboard shortcuts

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