koalanet

package module
v0.0.0-...-5025737 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2016 License: MIT Imports: 10 Imported by: 0

README

koalanet

Build Status GoDoc GitHub release

一个轻量的游戏服务器框架,go语言实现,Actor模式

Documentation

Index

Constants

View Source
const (
	HANDLE_MASK       uint32 = 0xFFFFFF
	DEFAULT_SLOT_SIZE uint32 = 4
)

Variables

This section is empty.

Functions

func Call

func Call(handle uint32, fname string, args interface{}, reply interface{}) error

func CallByName

func CallByName(name string, fname string, args interface{}, reply interface{}) error

func Exit

func Exit()

func KillActor

func KillActor(h uint32, force bool)

func KillActorByName

func KillActorByName(name string, force bool)

func NewActor

func NewActor(actorName string, args interface{}) uint32

func QueryName

func QueryName(name string) (uint32, error)

func RegActor

func RegActor(name string, fptr ActorNewFunc)

func RegName

func RegName(handle uint32, name string) error

func Run

func Run(mainActor string, maxThread int, debugEnable bool, debugPort string)

func Send

func Send(handle uint32, fname string, args interface{}) error

func SendByName

func SendByName(name string, fname string, args interface{}) error

func WaitActorQuit

func WaitActorQuit(handle uint32) error

func WaitAllQuit

func WaitAllQuit()

Types

type Actor

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

func (*Actor) GetHandle

func (a *Actor) GetHandle() uint32

func (*Actor) GetType

func (a *Actor) GetType() string

func (*Actor) InitActor

func (a *Actor) InitActor()

func (*Actor) OnMessage

func (a *Actor) OnMessage(funcName string, args interface{}, reply interface{}) error

func (*Actor) RegMethod

func (a *Actor) RegMethod(name string, callback ActorMethodCallback)

type ActorFactory

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

type ActorMethodCallback

type ActorMethodCallback func(args interface{}, reply interface{}) error

type ActorNewFunc

type ActorNewFunc func() IActor

type HandleStorage

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

type IActor

type IActor interface {
	GetHandle() uint32
	GetType() string
	OnMessage(funcName string, args interface{}, reply interface{}) error
	// contains filtered or unexported methods
}

type IActorMethod

type IActorMethod interface {
	Process() error
}

type SpinLock

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

func NewSpinLock

func NewSpinLock() *SpinLock

func (*SpinLock) Lock

func (locker *SpinLock) Lock()

func (*SpinLock) Unlock

func (locker *SpinLock) Unlock()

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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