evq

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COROUTINE_EVENT = 1
	CALLATER_EVT    = 2
	ClOSE_EVQ_EVT   = 3
)

Variables

This section is empty.

Functions

func Await

func Await(f func())

func CallLater

func CallLater(f func())

func CreateEventID

func CreateEventID() int

func HandleEvent

func HandleEvent(evid int, f func(event IEvent))

func Initialize

func Initialize(ctx contextx.Context)

func PostEvent

func PostEvent(ev IEvent)

Types

type CommonEvent

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

func NewCommonEvent

func NewCommonEvent(evenID int, data ...interface{}) *CommonEvent

func (*CommonEvent) GetData

func (ce *CommonEvent) GetData() []interface{}

func (*CommonEvent) GetEventId

func (ce *CommonEvent) GetEventId() int

func (*CommonEvent) String

func (ce *CommonEvent) String() string

type Coroutine

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

Coroutine implement IEvent

func (*Coroutine) Exit

func (c *Coroutine) Exit()

func (*Coroutine) GetEventId

func (c *Coroutine) GetEventId() int

func (*Coroutine) Resume

func (c *Coroutine) Resume(data interface{})

func (*Coroutine) String

func (c *Coroutine) String() string

func (*Coroutine) Yield

func (c *Coroutine) Yield() interface{}

type IEvent

type IEvent interface {
	GetEventId() int
}

Jump to

Keyboard shortcuts

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