Documentation ¶
Index ¶
- type EventPool
- func (e *EventPool) Emit(eventName string, args mrcore.EventArgs) error
- func (e *EventPool) EmitWithContext(ctx context.Context, eventName string, args mrcore.EventArgs) error
- func (e *EventPool) Has(eventName string) bool
- func (e *EventPool) List() []string
- func (e *EventPool) Listen(eventName string, handlerFunc mrcore.EventHandlerFunc)
- func (e *EventPool) Remove(eventNames ...string)
- func (e *EventPool) Wait()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventPool ¶ added in v0.10.0
type EventPool struct {
// contains filtered or unexported fields
}
EventPool - thread safe structure stores events, their handlers and functions for management
func NewEventPool ¶
func (*EventPool) EmitWithContext ¶ added in v0.10.0
func (e *EventPool) EmitWithContext(ctx context.Context, eventName string, args mrcore.EventArgs) error
EmitWithContext - Call eventName there
func (*EventPool) Has ¶ added in v0.10.0
Has - Checks if there are listeners for the passed eventName
func (*EventPool) List ¶ added in v0.10.0
List - Returns a list of events that listeners are subscribed to
func (*EventPool) Listen ¶ added in v0.10.0
func (e *EventPool) Listen(eventName string, handlerFunc mrcore.EventHandlerFunc)
Listen - Subscribe on eventName
Click to show internal directories.
Click to hide internal directories.