bus

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataBus

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

func NewDataBus

func NewDataBus() *DataBus

func (*DataBus) All

func (self *DataBus) All(fn func(DataBusContext)) (id int32)

func (*DataBus) Get

func (self *DataBus) Get(key string) (nson.Value, bool)

func (*DataBus) InitDataBus

func (self *DataBus) InitDataBus()

func (*DataBus) Insert

func (self *DataBus) Insert(key string, value nson.Value) (nson.Value, bool)

func (*DataBus) InsertSkipAll

func (self *DataBus) InsertSkipAll(key string, value nson.Value) (nson.Value, bool)

func (*DataBus) Off

func (self *DataBus) Off(id int32) (ok bool)

func (*DataBus) On

func (self *DataBus) On(key string, fn func(DataBusContext)) (id int32)

func (*DataBus) Remove

func (self *DataBus) Remove(key string) (nson.Value, bool)

func (*DataBus) Run

func (self *DataBus) Run(eventBus *EventBus, event string)

func (*DataBus) Set

func (self *DataBus) Set(key string, value nson.Value) (nson.Value, bool)

type DataBusContext

type DataBusContext struct {
	DataBus  *DataBus
	Id       int32
	Key      string
	OldValue nson.Value
	Value    nson.Value
}

type DataBusHandler

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

type EventBus

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

func NewEventBus

func NewEventBus() *EventBus

func (*EventBus) Emit

func (self *EventBus) Emit(event string, message nson.Message)

func (*EventBus) InitEventBus

func (self *EventBus) InitEventBus()

func (*EventBus) Off

func (self *EventBus) Off(id int32) (ok bool)

func (*EventBus) On

func (self *EventBus) On(event string, fn func(EventBusContext)) (id int32)

func (*EventBus) Push

func (self *EventBus) Push(event string, message nson.Message)

type EventBusContext

type EventBusContext struct {
	EventBus *EventBus
	Id       int32
	Event    string
	Message  nson.Message
}

type EventBusHandler

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

type Task

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

type Tasks

type Tasks []Task

func (Tasks) Len

func (h Tasks) Len() int

func (Tasks) Less

func (h Tasks) Less(i, j int) bool

func (*Tasks) Pop

func (h *Tasks) Pop() interface{}

func (*Tasks) Push

func (h *Tasks) Push(x interface{})

func (Tasks) Swap

func (h Tasks) Swap(i, j int)

type Timer

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

func NewTimer

func NewTimer() *Timer

func (*Timer) Pop

func (t *Timer) Pop() interface{}

func (*Timer) Push

func (t *Timer) Push(task Task)

func (*Timer) Run

func (t *Timer) Run(queen *EventBus)

Jump to

Keyboard shortcuts

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