Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventRouter ¶
type EventRouter struct {
// contains filtered or unexported fields
}
EventRouter is a channel event router. It will route events (or entities) based on the EUI. There may be multiple subscribers to the same EUI and each will receive a separate event. The channels are buffered and if the subscribers can't keep up with the events they will be dropped silently by the router.
func NewEventRouter ¶
func NewEventRouter(channelLength int) EventRouter
NewEventRouter creates a new event router
func (*EventRouter) Publish ¶
func (e *EventRouter) Publish(id interface{}, event interface{})
Publish publishes a gateway event to subscribers. If there are no subscribers the event will be ignored. If the event subscribers can't keep up with the events the events will be silently dropped.
func (*EventRouter) Subscribe ¶
func (e *EventRouter) Subscribe(identifier interface{}) <-chan interface{}
Subscribe subscribes to events for a particular gateway
func (*EventRouter) Unsubscribe ¶
func (e *EventRouter) Unsubscribe(ch <-chan interface{})
Unsubscribe from channel
Click to show internal directories.
Click to hide internal directories.