Documentation ¶
Index ¶
- type EventCache
- type EventSwitch
- func (evsw *EventSwitch) AddListenerForEvent(listenerID, event string, cb eventCallback)
- func (evsw *EventSwitch) FireEvent(event string, data types.EventData)
- func (evsw *EventSwitch) OnStart() error
- func (evsw *EventSwitch) OnStop()
- func (evsw *EventSwitch) RemoveListener(listenerID string)
- func (evsw *EventSwitch) RemoveListenerForEvent(event string, listenerID string)
- type Eventable
- type Fireable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventCache ¶
type EventCache struct {
// contains filtered or unexported fields
}
An EventCache buffers events for a Fireable All events are cached. Filtering happens on Flush
func NewEventCache ¶
func NewEventCache(evsw Fireable) *EventCache
Create a new EventCache with an EventSwitch as backend
func (*EventCache) FireEvent ¶
func (evc *EventCache) FireEvent(event string, data types.EventData)
Cache an event to be fired upon finality.
func (*EventCache) Flush ¶
func (evc *EventCache) Flush()
Fire events by running evsw.FireEvent on all cached events. Blocks. Clears cached events
type EventSwitch ¶
type EventSwitch struct { BaseService // contains filtered or unexported fields }
func NewEventSwitch ¶
func NewEventSwitch() *EventSwitch
func (*EventSwitch) AddListenerForEvent ¶
func (evsw *EventSwitch) AddListenerForEvent(listenerID, event string, cb eventCallback)
func (*EventSwitch) FireEvent ¶
func (evsw *EventSwitch) FireEvent(event string, data types.EventData)
func (*EventSwitch) OnStart ¶
func (evsw *EventSwitch) OnStart() error
func (*EventSwitch) OnStop ¶
func (evsw *EventSwitch) OnStop()
func (*EventSwitch) RemoveListener ¶
func (evsw *EventSwitch) RemoveListener(listenerID string)
func (*EventSwitch) RemoveListenerForEvent ¶
func (evsw *EventSwitch) RemoveListenerForEvent(event string, listenerID string)
Click to show internal directories.
Click to hide internal directories.