Documentation ¶
Index ¶
Constants ¶
View Source
const CONSUMER_BUFFER_SIZE = 10
Variables ¶
View Source
var ErrChannelClosed = errors.New("channel closed")
Functions ¶
func NewRateLimiter ¶
func NewRateLimiter() workqueue.RateLimiter
func SubscriberMatch ¶
func SubscriberMatch(subs Subscribers, topic string) ([]chan events.Event, bool)
SubscriberMatch match all the subscribers to the topic name
Types ¶
type Consumer ¶
type Consumer interface { Id() string OnEventSync(ctx context.Context) events.Event OnEvent() <-chan events.Event UnSubscribe() error }
func MergeConsumers ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
func NewEventBus ¶
NewEventBus creates a new EventBus that uses multiple workers to publish events to any subscribers
func (*EventBus) InjectLogger ¶
InjectLogger injectable logger https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/runtime/inject/inject.go
type EventConsumer ¶
type EventConsumer struct {
// contains filtered or unexported fields
}
func (EventConsumer) Id ¶
func (c EventConsumer) Id() string
func (EventConsumer) OnEvent ¶
func (c EventConsumer) OnEvent() <-chan events.Event
func (EventConsumer) OnEventSync ¶
func (c EventConsumer) OnEventSync(ctx context.Context) events.Event
func (EventConsumer) UnSubscribe ¶
func (c EventConsumer) UnSubscribe() error
type EventConsumerSet ¶
type EventConsumerSet struct {
// contains filtered or unexported fields
}
func (EventConsumerSet) Id ¶
func (c EventConsumerSet) Id() string
func (EventConsumerSet) OnEvent ¶
func (cs EventConsumerSet) OnEvent() <-chan events.Event
func (EventConsumerSet) OnEventSync ¶
func (cs EventConsumerSet) OnEventSync(ctx context.Context) events.Event
func (EventConsumerSet) UnSubscribe ¶
func (cs EventConsumerSet) UnSubscribe() error
type Subscribers ¶
Click to show internal directories.
Click to hide internal directories.