Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationTopic ¶
type NotificationTopic string
const ( NotificationTopicInsert NotificationTopic = "river_insert" NotificationTopicLeadership NotificationTopic = "river_leadership" NotificationTopicJobControl NotificationTopic = "river_job_control" )
type Notifier ¶
type Notifier struct { baseservice.BaseService startstop.BaseStartStop // contains filtered or unexported fields }
func New ¶
func New(archetype *baseservice.Archetype, listener riverdriver.Listener, statusChangeFunc func(componentstatus.Status)) *Notifier
func (*Notifier) Listen ¶
func (n *Notifier) Listen(ctx context.Context, topic NotificationTopic, notifyFunc NotifyFunc) (*Subscription, error)
type NotifyFunc ¶
type NotifyFunc func(topic NotificationTopic, payload string)
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func ListenRetryLoop ¶ added in v0.1.0
func ListenRetryLoop(ctx context.Context, baseService *baseservice.BaseService, notifier *Notifier, topic NotificationTopic, notifyFunc NotifyFunc) (*Subscription, error)
ListenRetryLoop tries to listen on a notification topic, but with a retry loop in case of an initial failure. This is a stopgap until services like the producer and elector can propagate errors back on start up, and subject to change.
func (*Subscription) Unlisten ¶
func (s *Subscription) Unlisten(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.