Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is an event manager to subscribe to and fire events.
func (*Manager) Fire ¶
Fire fires an event and returns after all subscribers are complete handling it. Any panic by a subscriber is caught so firing the event to the next subscriber can proceed .
func (*Manager) FireParallel ¶
FireParallel fires an event in a new goroutine and returns immediately. It optionally runs handlers after all subscribers are done and passes the potentially modified version of the fired event. If an after handler panics no further handlers in the slice will be run.
func (*Manager) Subscribe ¶
Subscribe subscribes a handler to an event type with a priority and returns a func that can be run to unsubscribe.
HandlerFn should return quick and start long running tasks in parallel (e.g. if the event has a proxy.Inbound/proxy.Player then use its Close method to get notified when to cancel background work).