Documentation ¶
Index ¶
- func NewEvent() types.EventCenter
- type Event
- func (e *Event) Notify(eventType types.EventType, value interface{}) (err error)
- func (e *Event) NotifyAll() (errs []error)
- func (e *Event) NotifySubscriber(eventFunc types.EventFunc, value interface{})
- func (e *Event) Subscribe(eventType types.EventType, eventFunc types.EventFunc) types.Subscriber
- func (e *Event) UnSubscribe(eventType types.EventType, subscriber types.Subscriber) (err error)
- func (e *Event) UnSubscribeAll()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEvent ¶
func NewEvent() types.EventCenter
Types ¶
type Event ¶
type Event struct { Subscribers map[types.EventType]map[types.Subscriber]types.EventFunc // contains filtered or unexported fields }
func (*Event) NotifySubscriber ¶
func (*Event) UnSubscribe ¶
UnSubscribe removes the specified subscriber
func (*Event) UnSubscribeAll ¶
func (e *Event) UnSubscribeAll()
unsubscribe all event and subscriber elegant
Click to show internal directories.
Click to hide internal directories.