Documentation ¶
Index ¶
- type SubscriptionsSupervisor
- func (s *SubscriptionsSupervisor) Connect(stopCh <-chan struct{})
- func (s *SubscriptionsSupervisor) Start(stopCh <-chan struct{}) error
- func (s *SubscriptionsSupervisor) UpdateHostToChannelMap(ctx context.Context, chanList []messagingv1alpha1.Channel) error
- func (s *SubscriptionsSupervisor) UpdateSubscriptions(channel *messagingv1alpha1.Channel, isFinalizer bool) (map[eventingduck.SubscriberSpec]error, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SubscriptionsSupervisor ¶
type SubscriptionsSupervisor struct {
// contains filtered or unexported fields
}
SubscriptionsSupervisor manages the state of NATS Streaming subscriptions
func NewDispatcher ¶
func NewDispatcher(natssURL, clusterID, clientID string, logger *zap.Logger) (*SubscriptionsSupervisor, error)
NewDispatcher returns a new SubscriptionsSupervisor.
func (*SubscriptionsSupervisor) Connect ¶
func (s *SubscriptionsSupervisor) Connect(stopCh <-chan struct{})
Connect is called for initial connection as well as after every disconnect
func (*SubscriptionsSupervisor) Start ¶
func (s *SubscriptionsSupervisor) Start(stopCh <-chan struct{}) error
func (*SubscriptionsSupervisor) UpdateHostToChannelMap ¶
func (s *SubscriptionsSupervisor) UpdateHostToChannelMap(ctx context.Context, chanList []messagingv1alpha1.Channel) error
UpdateHostToChannelMap will be called from the controller that watches natss channels. It will update internal hostToChannelMap which is used to resolve the hostHeader of the incoming request to the correct ChannelReference in the receiver function.
func (*SubscriptionsSupervisor) UpdateSubscriptions ¶
func (s *SubscriptionsSupervisor) UpdateSubscriptions(channel *messagingv1alpha1.Channel, isFinalizer bool) (map[eventingduck.SubscriberSpec]error, error)
UpdateSubscriptions creates/deletes the natss subscriptions based on channel.Spec.Subscribable.Subscribers Return type:map[eventingduck.SubscriberSpec]error --> Returns a map of subscriberSpec that failed with the value=error encountered. Ignore the value in case error != nil