app

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetApplicationInstanceId

func GetApplicationInstanceId() string

func GetName added in v0.0.9

func GetName() string

func GetTickRate

func GetTickRate() time.Duration

func PrepareApplicationInstanceId

func PrepareApplicationInstanceId() string

func SetName added in v0.0.9

func SetName(name string)

func SetTickRate

func SetTickRate(rate time.Duration)

Types

type Application

type Application interface {
	AddWorker(Worker)
	Execute()
}

func NewApplication

func NewApplication(name string) Application

type ApplicationImpl

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

func (*ApplicationImpl) AddWorker

func (a *ApplicationImpl) AddWorker(w Worker)

func (*ApplicationImpl) Deinit

func (a *ApplicationImpl) Deinit()

func (*ApplicationImpl) DoInMainThread

func (a *ApplicationImpl) DoInMainThread(t func(context.Context))

func (*ApplicationImpl) Execute

func (a *ApplicationImpl) Execute()

func (*ApplicationImpl) GetWg

func (a *ApplicationImpl) GetWg() *sync.WaitGroup

func (*ApplicationImpl) Init

func (a *ApplicationImpl) Init()

type Handle

type Handle interface {
	DoInMainThread(func(context.Context))
	GetWg() *sync.WaitGroup
}

type Worker

type Worker interface {
	Deinit(context.Context)
	Init(context.Context, Handle)
	DoWork(context.Context)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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