Documentation
¶
Index ¶
- type Event
- type EventBus
- func (bus *EventBus) AddListener(channelSize ...int) <-chan Event
- func (bus *EventBus) Close()
- func (bus *EventBus) Closed() bool
- func (bus *EventBus) HistorySize() int
- func (bus *EventBus) Raise(events ...Event)
- func (bus *EventBus) RemoveListener(listeners ...<-chan Event)
- func (bus *EventBus) Wait()
- func (bus *EventBus) WaitAndClose()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
EventBus is a multi consumer / multi producer bus
func (*EventBus) AddListener ¶
AddListener adds an listener to the bus all cached messages will be immediately passed to the listener
func (*EventBus) Close ¶
func (bus *EventBus) Close()
Close stops new events from being trigerred, however the listeners need to close them self
func (*EventBus) HistorySize ¶
HistorySize returns the events that will be stored for future channels
func (*EventBus) RemoveListener ¶
RemoveListener removes an listener from the bus
func (*EventBus) Wait ¶
func (bus *EventBus) Wait()
Wait waits until all listeners have been removed
func (*EventBus) WaitAndClose ¶
func (bus *EventBus) WaitAndClose()
WaitAndClose waits until all listeners have been removed and closes the bus
Click to show internal directories.
Click to hide internal directories.