Documentation ¶
Index ¶
- Constants
- Variables
- type Event
- type EventAction
- type EventActionHandler
- type EventCommon
- type EventFilter
- type EventFilterHandler
- type EventHandler
- type EventPriority
- type EventPublisher
- type EventSubscriber
- type Events
- func (es *Events) Publish(publisher string, event Event) error
- func (es *Events) PublishAndUnsubscribeAll(publisher string, event Event) error
- func (es *Events) Subscribe(publisher string, priority EventPriority, subscriber string, ...) error
- func (es *Events) Unsubscribe(publisher string, subscriber string)
- type Exception
- type Exception_StackFilter
- type Task
- type TaskMethods
- type TaskSet
- type Task_Status
Constants ¶
View Source
const ( EventPriority_Earliest = math.MinInt8 EventPriority_Mediocre = 0 EventPriority_Latest = math.MaxInt8 )
View Source
const ( Task_Status_BrandNew = iota Task_Status_Staring Task_Status_Running Task_Status_Stopping Task_Status_Stopped )
Variables ¶
View Source
var ( EM_Event_Uninitialized = types.NewMask( "Event:UninitializedObject", "对象未初始化", ) EM_Event_DuplicateSubscriberName = types.NewMask( "Event:DuplicateSubscriberName", "订阅者名称冲突:{{name}}", ) EM_Event_Locked = types.NewMask( "Event:Locked", "事件已被锁定,无法重新执行", ) EM_Event_FilterError = types.NewMask( "Event:FilterError", "过滤器抛出了未被处理的错误", ) EM_Event_UnhandledError = types.NewMask( "Event:UnhandledException", "事件 {{publisher}} 产生了 {{n}} 未被处理的错误", ) )
View Source
var ( EM_Tasks_DuplicatedTask = types.NewMask( "Tasks:DuplicatedTask", "任务不能被重复注册", ) EM_Tasks_UnhandledErrors = types.NewMask( "Tasks:UnhandledErrors", "任务抛出了未被处理的错误", ) )
View Source
var Exception_TextWrapperStyle_Cause = typeUtils.Text_WrapperOption{
Char_LeftTop: '^',
Char_LeftMain: '│',
Char_LeftBottom: '└',
Char_BottomMain: '─',
Indent_Title: 1,
Indent_Content: 2,
}
View Source
var Exception_TextWrapperStyle_Trace = typeUtils.Text_WrapperOption{
Char_LeftTop: '>',
Char_LeftMain: '│',
Char_LeftBottom: '└',
Char_BottomMain: '─',
Indent_Title: 1,
Indent_Content: 2,
}
Functions ¶
This section is empty.
Types ¶
type EventAction ¶
type EventAction struct { EventCommon // contains filtered or unexported fields }
func NewEventAction ¶
func NewEventAction(handler EventActionHandler, payload interface{}) *EventAction
func (*EventAction) CommitPayload ¶
func (ea *EventAction) CommitPayload(payload interface{}) error
func (*EventAction) IsEvent ¶
func (ea *EventAction) IsEvent()
type EventActionHandler ¶
type EventActionHandler func(this *EventAction, actionArg interface{}) (err error)
type EventCommon ¶
type EventCommon struct {
// contains filtered or unexported fields
}
func (*EventCommon) GetPayload ¶
func (eu *EventCommon) GetPayload() interface{}
func (*EventCommon) Lock ¶
func (eu *EventCommon) Lock()
func (*EventCommon) Locked ¶
func (eu *EventCommon) Locked() bool
func (*EventCommon) UnLock ¶
func (eu *EventCommon) UnLock()
type EventFilter ¶
type EventFilter struct { EventCommon // contains filtered or unexported fields }
func NewEventFilter ¶
func NewEventFilter(handler EventFilterHandler, payload interface{}) *EventFilter
func (*EventFilter) CommitPayload ¶
func (ef *EventFilter) CommitPayload(payload interface{}) error
func (*EventFilter) IsEvent ¶
func (ef *EventFilter) IsEvent()
type EventFilterHandler ¶
type EventFilterHandler func(this *EventFilter, filterArg interface{}) (newPayload interface{}, err error)
type EventHandler ¶
type EventPriority ¶
type EventPriority int8
type EventPublisher ¶
type EventPublisher struct { Subscribers map[string]*EventSubscriber // contains filtered or unexported fields }
func (*EventPublisher) GenerateExecOrderCache ¶
func (ep *EventPublisher) GenerateExecOrderCache()
type EventSubscriber ¶
type EventSubscriber struct { Priority EventPriority Handler EventHandler }
type Events ¶
type Events struct {
Publishers map[string]*EventPublisher
}
func GlobalEvents ¶
func GlobalEvents() *Events
func (*Events) PublishAndUnsubscribeAll ¶
func (*Events) Subscribe ¶
func (es *Events) Subscribe( publisher string, priority EventPriority, subscriber string, handler EventHandler, ) error
func (*Events) Unsubscribe ¶
type Exception ¶
type Exception struct { types.SimpleThrowable // contains filtered or unexported fields }
func AsException ¶
func NewException ¶
func (*Exception) GetMessage ¶
func (*Exception) SetStackFilter ¶
func (t *Exception) SetStackFilter(filter Exception_StackFilter) *Exception
func (*Exception) StackTrace ¶
func (t *Exception) StackTrace() errors.StackTrace
type Exception_StackFilter ¶
type Task ¶
type Task interface { Start() error Stop() error GetStatus() Task_Status SetStatus(status Task_Status) bool // contains filtered or unexported methods }
type TaskMethods ¶
type TaskMethods struct { Task // contains filtered or unexported fields }
func (*TaskMethods) GetStatus ¶
func (t *TaskMethods) GetStatus() Task_Status
func (*TaskMethods) SetStatus ¶
func (t *TaskMethods) SetStatus(status Task_Status) bool
type TaskSet ¶
type TaskSet struct {
// contains filtered or unexported fields
}
func NewTaskSet ¶
func NewTaskSet() *TaskSet
func (*TaskSet) CancelWait ¶
func (ts *TaskSet) CancelWait()
type Task_Status ¶
type Task_Status uint8
Click to show internal directories.
Click to hide internal directories.