Documentation ¶
Index ¶
- Constants
- func FireEvent(e Event)
- func FireEventWait(e Event) (result interface{}, ok bool)
- func NewRoutine(ChanSize int64) (ret *routine)
- type DefaultEventHandlerContext
- func (this *DefaultEventHandlerContext) FireExceptionCaught(err error) (invoker EventInboundInvoker)
- func (this *DefaultEventHandlerContext) FireUpEvent(event interface{}) (invoker EventInboundInvoker)
- func (this *DefaultEventHandlerContext) Get(key string) (value interface{})
- func (this *DefaultEventHandlerContext) Handler() (handler EventHandler)
- func (this *DefaultEventHandlerContext) Pipeline() (pipeline EventPipeline)
- func (this *DefaultEventHandlerContext) Set(key string, value interface{})
- type DefaultEventPipeline
- func (this *DefaultEventPipeline) AddFirst(name string, handler EventHandler) (pipeline EventPipeline)
- func (this *DefaultEventPipeline) AddLast(name string, handler EventHandler) (pipeline EventPipeline)
- func (this *DefaultEventPipeline) FireExceptionCaught(err error) (invoker EventInboundInvoker)
- func (this *DefaultEventPipeline) FireUpEvent(event interface{}) (invoker EventInboundInvoker)
- type Event
- type EventHandler
- type EventHandlerContext
- type EventInboundHandler
- type EventInboundInvoker
- type EventInitializer
- type EventPipeline
- type HeadHandler
- type IExecutor
- type IRoutinePoolBuilder
- type RoutinePool
- type TailHandler
Constants ¶
View Source
const ( DefaultPoolSize int64 = 10000 DefaultChanSize int64 = 1000 )
Variables ¶
This section is empty.
Functions ¶
func FireEventWait ¶
func NewRoutine ¶
func NewRoutine(ChanSize int64) (ret *routine)
Types ¶
type DefaultEventHandlerContext ¶
type DefaultEventHandlerContext struct { Name string Next *DefaultEventHandlerContext Prev *DefaultEventHandlerContext // contains filtered or unexported fields }
func NewDefaultEventHandlerContext ¶
func NewDefaultEventHandlerContext(name string, pipeline EventPipeline, handler EventHandler) (context *DefaultEventHandlerContext)
func (*DefaultEventHandlerContext) FireExceptionCaught ¶
func (this *DefaultEventHandlerContext) FireExceptionCaught(err error) (invoker EventInboundInvoker)
func (*DefaultEventHandlerContext) FireUpEvent ¶
func (this *DefaultEventHandlerContext) FireUpEvent(event interface{}) (invoker EventInboundInvoker)
func (*DefaultEventHandlerContext) Get ¶
func (this *DefaultEventHandlerContext) Get(key string) (value interface{})
func (*DefaultEventHandlerContext) Handler ¶
func (this *DefaultEventHandlerContext) Handler() (handler EventHandler)
func (*DefaultEventHandlerContext) Pipeline ¶
func (this *DefaultEventHandlerContext) Pipeline() (pipeline EventPipeline)
func (*DefaultEventHandlerContext) Set ¶
func (this *DefaultEventHandlerContext) Set(key string, value interface{})
type DefaultEventPipeline ¶
type DefaultEventPipeline struct { Lock *sync.Mutex Head *DefaultEventHandlerContext Tail *DefaultEventHandlerContext }
func NewDefaultEventPipeline ¶
func NewDefaultEventPipeline() (pipeline *DefaultEventPipeline)
func (*DefaultEventPipeline) AddFirst ¶
func (this *DefaultEventPipeline) AddFirst(name string, handler EventHandler) (pipeline EventPipeline)
func (*DefaultEventPipeline) AddLast ¶
func (this *DefaultEventPipeline) AddLast(name string, handler EventHandler) (pipeline EventPipeline)
func (*DefaultEventPipeline) FireExceptionCaught ¶
func (this *DefaultEventPipeline) FireExceptionCaught(err error) (invoker EventInboundInvoker)
func (*DefaultEventPipeline) FireUpEvent ¶
func (this *DefaultEventPipeline) FireUpEvent(event interface{}) (invoker EventInboundInvoker)
type EventHandler ¶
type EventHandler interface {
OnExceptionCaught(ctx EventHandlerContext, err error)
}
type EventHandlerContext ¶
type EventHandlerContext interface { EventInboundInvoker Handler() (handler EventHandler) Pipeline() (pipeline EventPipeline) }
type EventInboundHandler ¶
type EventInboundHandler interface { EventHandler OnEventUp(ctx EventHandlerContext, e interface{}) (ret interface{}) }
type EventInboundInvoker ¶
type EventInboundInvoker interface { FireExceptionCaught(err error) (invoker EventInboundInvoker) FireUpEvent(event interface{}) (invoker EventInboundInvoker) }
type EventInitializer ¶
type EventInitializer interface {
InitChannel(pipeline EventPipeline)
}
type EventPipeline ¶
type EventPipeline interface { EventInboundInvoker AddFirst(name string, handler EventHandler) (pipeline EventPipeline) AddLast(name string, handler EventHandler) (pipeline EventPipeline) }
type HeadHandler ¶
type HeadHandler struct { }
func (*HeadHandler) OnEventUp ¶
func (this *HeadHandler) OnEventUp(ctx EventHandlerContext, e interface{}) (ret interface{})
func (*HeadHandler) OnExceptionCaught ¶
func (this *HeadHandler) OnExceptionCaught(ctx EventHandlerContext, err error)
type IRoutinePoolBuilder ¶
type IRoutinePoolBuilder interface {
GetRoutinePool(int64) *RoutinePool
}
type RoutinePool ¶
type RoutinePool struct {
// contains filtered or unexported fields
}
func NewRoutinePool ¶
func NewRoutinePool(PoolSize int64, ChanSize int64) (pool *RoutinePool)
func (*RoutinePool) Exec ¶
func (this *RoutinePool) Exec(event Event)
func (*RoutinePool) FireEvent ¶
func (this *RoutinePool) FireEvent(e Event)
func (*RoutinePool) FireEventWait ¶
func (this *RoutinePool) FireEventWait(e Event) (result interface{}, ok bool)
发送内部STS消息(玩家不一定在线)
func (*RoutinePool) ShutDown ¶
func (this *RoutinePool) ShutDown()
type TailHandler ¶
type TailHandler struct { }
func (*TailHandler) OnEventUp ¶
func (this *TailHandler) OnEventUp(ctx EventHandlerContext, e interface{}) (ret interface{})
func (*TailHandler) OnExceptionCaught ¶
func (this *TailHandler) OnExceptionCaught(ctx EventHandlerContext, err error)
Click to show internal directories.
Click to hide internal directories.