gevent

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: LGPL-3.0 Imports: 3 Imported by: 1

README

gevent

介绍

一个简单的事件Loop.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultEventReactor

type DefaultEventReactor struct {
}

func (DefaultEventReactor) OnAfterHandle

func (d DefaultEventReactor) OnAfterHandle(id int32, evCmd int64, extras []interface{})

func (DefaultEventReactor) OnBeforeHandle

func (d DefaultEventReactor) OnBeforeHandle(id int32, evCmd int64, extras []interface{})

func (DefaultEventReactor) OnBeginEventLoop

func (d DefaultEventReactor) OnBeginEventLoop(id int32)

func (DefaultEventReactor) OnCmdHandle

func (d DefaultEventReactor) OnCmdHandle(id int32, evCmd int64, extras []interface{})

func (DefaultEventReactor) OnFinishEventLoop

func (d DefaultEventReactor) OnFinishEventLoop(id int32)

type EventCommand

type EventCommand struct {
	EvCmd  int64
	Extras []interface{}
}

EventCommand 事件指令载体

type EventLoop

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

func NewEventLoop

func NewEventLoop(cxt context.Context, reactor IEventReactor) *EventLoop

func (*EventLoop) InitCmdQueueSize

func (self *EventLoop) InitCmdQueueSize(queSize uint32)

func (*EventLoop) Launch

func (self *EventLoop) Launch() int32

func (*EventLoop) PostCmd

func (self *EventLoop) PostCmd(cmd *EventCommand)

func (*EventLoop) PostMsg

func (self *EventLoop) PostMsg(evCmd int64, extras ...interface{})

func (*EventLoop) Stop

func (self *EventLoop) Stop()

func (*EventLoop) StopAndWait

func (self *EventLoop) StopAndWait()

func (*EventLoop) Wait

func (self *EventLoop) Wait()

type IEventReactor

type IEventReactor interface {
	OnBeforeHandle(id int32, evCmd int64, extras []interface{})
	OnCmdHandle(id int32, evCmd int64, extras []interface{})
	OnAfterHandle(id int32, evCmd int64, extras []interface{})
	OnFinishEventLoop(id int32)
	OnBeginEventLoop(id int32)
}

Jump to

Keyboard shortcuts

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