app

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetApplicationInstanceId

func GetApplicationInstanceId() string

func GetApplicationName

func GetApplicationName() string

func GetTickRate

func GetTickRate() time.Duration

func PrepareApplicationInstanceId

func PrepareApplicationInstanceId() string

func SetApplicationName

func SetApplicationName(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())

func (*ApplicationImpl) Execute

func (a *ApplicationImpl) Execute()

func (*ApplicationImpl) GetCtx

func (a *ApplicationImpl) GetCtx() context.Context

func (*ApplicationImpl) GetWg

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

func (*ApplicationImpl) Init

func (a *ApplicationImpl) Init()

func (*ApplicationImpl) Quit

func (a *ApplicationImpl) Quit()

type Handle

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

type Worker

type Worker interface {
	Deinit()
	Init(Handle)
	DoWork()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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