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 Events ¶
type Events struct {
// contains filtered or unexported fields
}
Type Events is responsible for event publishing and processing. Currently, it has a hard-coded map of events to event handlers. When an event is published, Events 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 NewEvents ¶
func NewEvents(cfg *config.EventConfig, cf *secureconn.Factory) *Events
func (Events) Publish ¶
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.
Click to show internal directories.
Click to hide internal directories.