Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateShimQueue ¶
Create a queue shim
Types ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
A simplistic pub/sub system.
All methods are thread/GoRoutine safe. See Close() for some related caveats. Slow/laggy handlers should not slow down routines Emit()ing events. All messages will be received in the same order on all handlers.
func CreateEventBus ¶
func CreateEventBus() *EventBus
Create an EventBus and start all related GoRoutines.
func (*EventBus) Close ¶
func (bus *EventBus) Close()
Shutdown the event bus.
This will drain all current messages from the queues before closing the handler channels passed to Register(). After closing an EventBus, any attempt to Emit() a message will cause a panic.
func (*EventBus) Unregister ¶
Unregister an event handler.
Click to show internal directories.
Click to hide internal directories.