event

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent = agent.Agent

type AwaitRpcEventMsg

type AwaitRpcEventMsg struct {
	MsgType EventType
	Sender  Agent
	RpcName string
	Data    []interface{}
	Await   chan []interface{}
}

func (*AwaitRpcEventMsg) GetSender

func (m *AwaitRpcEventMsg) GetSender() Agent

func (*AwaitRpcEventMsg) GetType

func (m *AwaitRpcEventMsg) GetType() EventType

func (*AwaitRpcEventMsg) Reset

func (m *AwaitRpcEventMsg) Reset()

type Component

type Component = component.Component

type ComponentEventMsg

type ComponentEventMsg struct {
	MsgType EventType
	Sender  Component
	Attach  interface{}
	Err     error
}

func (*ComponentEventMsg) GetSender

func (m *ComponentEventMsg) GetSender() interface{}

func (*ComponentEventMsg) GetType

func (m *ComponentEventMsg) GetType() EventType

func (*ComponentEventMsg) Reset

func (m *ComponentEventMsg) Reset()

type ComponentID

type ComponentID = component.ComponentID

type CustomActionEventMsg

type CustomActionEventMsg interface {
	GetType() EventType
	GetSender() Agent
	GetAction() func(CustomActionEventMsg)
}

type DataEventMsg

type DataEventMsg struct {
	MsgType EventType
	Sender  Agent
	TypeID  ProtoTypeID
	MsgData interface{}
}

func (*DataEventMsg) GetSender

func (m *DataEventMsg) GetSender() Agent

func (*DataEventMsg) GetType

func (m *DataEventMsg) GetType() EventType

func (*DataEventMsg) Reset

func (m *DataEventMsg) Reset()

type EventChan

type EventChan chan bool

type EventMsg

type EventMsg interface {
	GetType() EventType
	Reset()
}

type EventQueue

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

func NewEventQueue

func NewEventQueue() *EventQueue

func (*EventQueue) Get

func (q *EventQueue) Get(event_list []interface{}, count uint32) uint32

func (*EventQueue) Push

func (q *EventQueue) Push(event EventMsg)

func (*EventQueue) SemaChan

func (q *EventQueue) SemaChan() EventChan

func (*EventQueue) WaitNotify

func (q *EventQueue) WaitNotify() bool

func (*EventQueue) WaiterWake

func (q *EventQueue) WaiterWake()

type EventReceiver

type EventReceiver interface {
	PostEvent(EventType, Agent, ComponentID, ...interface{})
	PostData(EventType, ProtoTypeID, Agent, interface{})
	PushEventMsg(ev EventMsg)
}

type EventType

type EventType = int
const (
	EVENT_NONE EventType = iota
	EVENT_TCP_CONNECTED
	EVENT_TCP_CONNECT_FAILED
	EVENT_TCP_ACCEPTED
	EVENT_TCP_READ_MSG
	EVENT_TCP_READ
	EVENT_TCP_WRITE
	EVENT_TCP_CLOSED
	EVENT_MODULE_RPC
	EVENT_MODULE_AWAITRPC
	EVENT_COMPONENT_CREATE
	EVENT_COMPONENT_ERROR
	EVENT_COMPONENT_CUSTOM
)

type ProtoTypeID

type ProtoTypeID = agent.ProtoTypeID

type RpcEventMsg

type RpcEventMsg struct {
	MsgType EventType
	Sender  Agent
	RpcName string
	Data    []interface{}
}

func (*RpcEventMsg) GetSender

func (m *RpcEventMsg) GetSender() Agent

func (*RpcEventMsg) GetType

func (m *RpcEventMsg) GetType() EventType

func (*RpcEventMsg) Reset

func (m *RpcEventMsg) Reset()

type SessionEventMsg

type SessionEventMsg struct {
	MsgType EventType
	Sender  Agent
	Cid     ComponentID
	Args    []interface{}
}

func (*SessionEventMsg) GetSender

func (m *SessionEventMsg) GetSender() Agent

func (*SessionEventMsg) GetType

func (m *SessionEventMsg) GetType() EventType

func (*SessionEventMsg) Reset

func (m *SessionEventMsg) Reset()

Jump to

Keyboard shortcuts

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