module

package
v0.0.0-...-33207d9 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy()

Destroy 模块关闭 模块关闭的顺序和模块注册顺序相反 模块启动后才能关闭,否则等待模块启动完成

func Init

func Init()

func Register

func Register(mi Module)

Register 模块注册

Types

type Module

type Module interface {
	OnInit()
	OnDestroy()
	Run(closeSig chan struct{})
}

Module 模块接口

type Skeleton

type Skeleton struct {
	// go
	GoLen int

	// timer dispatcher
	TimerDispatcherLen int

	// channel rpc client
	AsyncCallLen int

	ChanRPCServer *chanrpc.Server
	// contains filtered or unexported fields
}

func (*Skeleton) AfterFunc

func (s *Skeleton) AfterFunc(d time.Duration, cb func()) *timer.Timer

func (*Skeleton) AsyncCall

func (s *Skeleton) AsyncCall(server *chanrpc.Server, id interface{}, args ...interface{})

func (*Skeleton) CronFunc

func (s *Skeleton) CronFunc(expr *timer.CronExpr, cb func()) *timer.Cron

func (*Skeleton) Go

func (s *Skeleton) Go(f, cb func())

func (*Skeleton) Init

func (s *Skeleton) Init()

func (*Skeleton) NewLinearContext

func (s *Skeleton) NewLinearContext() *g.LinearContext

func (*Skeleton) RegisterChanRPC

func (s *Skeleton) RegisterChanRPC(id, f interface{})

func (*Skeleton) RegisterCommand

func (s *Skeleton) RegisterCommand(name, help string, f interface{})

func (*Skeleton) Run

func (s *Skeleton) Run(closeSig chan struct{})

Jump to

Keyboard shortcuts

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