schedule

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IChannelInboundCommandMaker

type IChannelInboundCommandMaker interface {
	//触发异常
	MakeExceptionCommand(ctx service.IChannelContext, err error) ICommand

	//新连接
	MakeActiveCommand(Ctx service.IChannelContext) ICommand
	//连接中断
	MakeInActiveCommand(Ctx service.IChannelContext) ICommand
	//收到消息包
	MakeMessageReceivedCommand(Ctx service.IChannelContext, Data interface{}) ICommand
}

type IChannelOutboundCommandMaker

type IChannelOutboundCommandMaker interface {
	// 触发异常
	MakeExceptionCommand(ctx service.IChannelContext, err error) ICommand

	// 请求关闭连接
	MakeCloseCommand(Ctx service.IChannelContext) ICommand
	// 下发消息包
	MakeMessageSendCommand(Ctx service.IChannelContext, Data interface{}) ICommand
}

type ICommand

type ICommand interface {
	Exec()
}

type IRoutineInboundEventMaker

type IRoutineInboundEventMaker interface {
	//收到消息包
	MakeMessageReceivedEvent(routineId int64, Data protocol.IProtocol, Ctx service.IChannelContext) executor.Event
	//新连接
	MakeActiveEvent(routineId int64, Ctx service.IChannelContext) executor.Event
	//连接中断
	MakeInActiveEvent(routineId int64, Ctx service.IChannelContext) executor.Event
}

Inbound

type IRoutineOutboundEventMaker

type IRoutineOutboundEventMaker interface {
	//发起连接
	MakeConnectEvent(routineId int64, ip string, port int, uID int64, params map[string]interface{}) executor.Event
	//关闭连接
	MakeCloseEvent(routineId int64, uID int64, Desc string) executor.Event
	//下发消息包:OnClose是否在消息发送完毕后关闭连接
	MakeSendMessageEvent(routineId int64, Data protocol.IProtocol, OnClose bool, PoolKey int64, ChlCtx service.IChannelContext, Desc string) executor.Event
}

Outbound

type InBoundExecutionHandler

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

UpBase --->

func NewInBoundExecutionHandler

func NewInBoundExecutionHandler(mInboundCommandMaker IChannelInboundCommandMaker) (this *InBoundExecutionHandler)

func (*InBoundExecutionHandler) ChannelActive

func (handler *InBoundExecutionHandler) ChannelActive(ctx channel.ChannelContext) (goonNext bool)

func (*InBoundExecutionHandler) ChannelInactive

func (handler *InBoundExecutionHandler) ChannelInactive(ctx channel.ChannelContext) (goonNext bool)

func (*InBoundExecutionHandler) ExceptionCaught

func (handler *InBoundExecutionHandler) ExceptionCaught(ctx channel.ChannelContext, err error)

func (*InBoundExecutionHandler) MessageReceived

func (handler *InBoundExecutionHandler) MessageReceived(ctx channel.ChannelContext, e interface{}) (ret interface{}, goonNext bool)

Jump to

Keyboard shortcuts

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