Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler interface { HandleEvent(*api.EventMsg) GetHandlerType() string GetClient() EventHandlerClient }
type EventHandlerClient ¶
type EventHandlerClient interface { // TODO: CallOption? HandleEvent(ctx context.Context, in *api.EventMsg, opts ...grpc.CallOption) (*api.EventResponse, error) }
type EventService ¶
Type EventService is responsible for event publishing and processing. Currently, it has a hard-coded map of events to event handlers. When an event is published, EventService gets the event off its input channel and matches the event with the correct handler function. Handler functions are started in their own goroutines.
func NewEventService ¶
func NewEventService(cfg *config.EventConfig, cf *secureconn.Factory) *EventService
func (*EventService) Publish ¶
func (svc *EventService) Publish(event *api.EventMsg)
Other services call publish on the event service api in order to notify the rest of the system of an event. Services should fire events in their own goroutines so that they are not blocked if the event input queue is full.
func (*EventService) Start ¶
func (svc *EventService) Start(r Registry) error
Start the event processor that listens on the in channel and fires off event handlers for each event received.