module

package
v0.0.0-...-372ebbf Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MODULE_TIMER_INTERVAL = 1
	MODULE_EVENT_LENGTH   = 128
)
View Source
var PerfomancePrint bool = false

Functions

func Close

func Close()

func Start

func Start()

Types

type Agent

type Agent = agent.Agent

type AgentID

type AgentID = agent.AgentID

func GenModuleID

func GenModuleID() AgentID

type ArgsVar

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

func (*ArgsVar) Length

func (s *ArgsVar) Length() int

func (*ArgsVar) Read

func (s *ArgsVar) Read(i int) interface{}

func (*ArgsVar) ReadBool

func (s *ArgsVar) ReadBool(i int) bool

func (*ArgsVar) ReadDouble

func (s *ArgsVar) ReadDouble(i int) float64

func (*ArgsVar) ReadInt

func (s *ArgsVar) ReadInt(i int) int

func (*ArgsVar) ReadInt32

func (s *ArgsVar) ReadInt32(i int) int32

func (*ArgsVar) ReadInt64

func (s *ArgsVar) ReadInt64(i int) int64

func (*ArgsVar) ReadString

func (s *ArgsVar) ReadString(i int) string

func (*ArgsVar) ReadUInt64

func (s *ArgsVar) ReadUInt64(i int) uint64

type AwaitRpcEventMsg

type AwaitRpcEventMsg = event.AwaitRpcEventMsg

type Component

type Component = component.Component

type ComponentEventMsg

type ComponentEventMsg = event.ComponentEventMsg

type ComponentID

type ComponentID = component.ComponentID

type ComponentMgr

type ComponentMgr interface {
	OnComponentCreate(Context, ComponentID)
	OnComponentError(Context, error)
}

type Context

type Context = context.Context

type CustomActionEventMsg

type CustomActionEventMsg = event.CustomActionEventMsg

type DataEventMsg

type DataEventMsg = event.DataEventMsg

type EventMsg

type EventMsg = event.EventMsg

type EventQueue

type EventQueue = event.EventQueue

type EventType

type EventType = event.EventType

type Module

type Module = context.Module

func FindModule

func FindModule(name string) Module

func GetModule

func GetModule(name string) Module

func NewModule

func NewModule(name string) Module

type ModuleContext

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

func (*ModuleContext) Done

func (c *ModuleContext) Done(args ...interface{})

func (*ModuleContext) Get

func (c *ModuleContext) Get(k int) interface{}

func (*ModuleContext) GetAttach

func (c *ModuleContext) GetAttach() interface{}

func (*ModuleContext) GetComponent

func (c *ModuleContext) GetComponent() Component

func (*ModuleContext) GetModule

func (c *ModuleContext) GetModule() Module

func (*ModuleContext) GetSender

func (c *ModuleContext) GetSender() Agent

func (*ModuleContext) Reset

func (c *ModuleContext) Reset()

func (*ModuleContext) Store

func (c *ModuleContext) Store(k int, v interface{})

type ModuleRouter

type ModuleRouter interface {
	RouterMsg(Agent, ProtoTypeID, interface{})
	RouterRpc(Agent, string, []interface{})
	RegisterHandler(ProtoTypeID, MsgHandler)
	RegisterRpcHandler(string, RpcHandler)
}

type ModuleWoker

type ModuleWoker interface {
	Close()
	Run(*sync.WaitGroup)
}

type ModuleWorkerPool

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

func (*ModuleWorkerPool) Balancer

func (this *ModuleWorkerPool) Balancer() Module

func (*ModuleWorkerPool) Close

func (this *ModuleWorkerPool) Close()

func (*ModuleWorkerPool) Const

func (this *ModuleWorkerPool) Const(n string) Module

func (*ModuleWorkerPool) ForEachModule

func (this *ModuleWorkerPool) ForEachModule(f func(m Module))

func (*ModuleWorkerPool) RegisterHandler

func (this *ModuleWorkerPool) RegisterHandler(type_id ProtoTypeID, f MsgHandler)

func (*ModuleWorkerPool) RegisterRpcHandler

func (this *ModuleWorkerPool) RegisterRpcHandler(name string, f RpcHandler)

func (*ModuleWorkerPool) RpcCall

func (this *ModuleWorkerPool) RpcCall(name string, args ...interface{})

func (*ModuleWorkerPool) Slot

func (this *ModuleWorkerPool) Slot(n int) Module

func (*ModuleWorkerPool) Start

func (this *ModuleWorkerPool) Start()

type MsgHandler

type MsgHandler func(Context, interface{})

type ProtoTypeID

type ProtoTypeID = uint32

type RpcEventMsg

type RpcEventMsg = event.RpcEventMsg

type RpcHandler

type RpcHandler func(Context, *ArgsVar)

type SessionEventMsg

type SessionEventMsg = event.SessionEventMsg

type SessionMgr

type SessionMgr = network.SessionMgr

type TimerHandler

type TimerHandler = timer.TimerHandler

type TimerManager

type TimerManager = timer.TimerManager

type WorkerPool

type WorkerPool interface {
	ForEachModule(func(m Module))
	RegisterRpcHandler(string, RpcHandler)
	RegisterHandler(ProtoTypeID, MsgHandler)
	RpcCall(string, ...interface{})
	Balancer() Module
	Const(string) Module
	Slot(int) Module
}

func CreateWorkers

func CreateWorkers(name string, size int) WorkerPool

func GetWorkerPool

func GetWorkerPool(name string) WorkerPool

Jump to

Keyboard shortcuts

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