kkdaemon

package module
v1.2.22 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const StateRun = int32(1)
View Source
const StateStop = int32(2)
View Source
const StateWait = int32(0)

Variables

View Source
var AutoStopWhenKill = true
View Source
var DaemonMap = sync.Map{}

Functions

func IsShutdown added in v1.1.3

func IsShutdown() bool

func RegisterDaemon added in v1.1.0

func RegisterDaemon(order int, daemon Daemon) error

func RegisterServiceInline added in v1.0.2

func RegisterServiceInline(name string, order int, startFunc func(), stopFunc func(sig os.Signal)) error

func ShutdownDone added in v1.2.18

func ShutdownDone() concurrent.Future

func ShutdownGracefully added in v1.2.0

func ShutdownGracefully()

func Start

func Start()

func Stop

func Stop(sig os.Signal)

func WaitShutdown added in v1.2.0

func WaitShutdown()

Types

type Daemon added in v1.1.0

type Daemon interface {
	Registered() error
	State() int32
	Start()
	Stop(sig os.Signal)
	Name() string
	// contains filtered or unexported methods
}

type DaemonEntity added in v1.1.0

type DaemonEntity struct {
	Name   string
	Daemon Daemon
	Order  int
	// contains filtered or unexported fields
}

func GetService

func GetService(name string) *DaemonEntity

type DefaultDaemon added in v1.1.0

type DefaultDaemon struct {
	Params map[string]interface{}
	// contains filtered or unexported fields
}

func (*DefaultDaemon) Name added in v1.1.6

func (d *DefaultDaemon) Name() string

func (*DefaultDaemon) Registered added in v1.1.5

func (d *DefaultDaemon) Registered() error

func (*DefaultDaemon) Start added in v1.1.0

func (d *DefaultDaemon) Start()

func (*DefaultDaemon) State added in v1.2.18

func (d *DefaultDaemon) State() int32

func (*DefaultDaemon) Stop added in v1.1.0

func (d *DefaultDaemon) Stop(sig os.Signal)

type DefaultTimerDaemon added in v1.2.7

type DefaultTimerDaemon struct {
	DefaultDaemon
	// contains filtered or unexported fields
}

func (*DefaultTimerDaemon) Interval added in v1.2.18

func (d *DefaultTimerDaemon) Interval() time.Duration

func (*DefaultTimerDaemon) Loop added in v1.2.7

func (d *DefaultTimerDaemon) Loop() error

type PanicResult

type PanicResult struct {
	Daemon Daemon
	Caught kkpanic.Caught
}

type TimerDaemon added in v1.2.7

type TimerDaemon interface {
	Daemon
	Interval() time.Duration
	Loop() error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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